Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - doc.ios

Pages: [1]
Support / 2D user interface in front of the 3D scene?
« on: October 28, 2010, 07:22:15 pm »
What is the jPCT-AE way of drawing buttons, text and UI stuff in front of the 3D scene?  A layer that doesn't move when the 3D stuff behind it does stuff.

Support / ShadowHelper?
« on: October 28, 2010, 06:58:16 pm »
Sorry, dumb newbie question.  Tired and late too - so not too bright right now.

I wanted to put shadows in.  But I can't find the ShadowHelper class.  Is it included in the Android library?  What's the import path?  Or is there another recommended way to do shadows on an Android device?

Support / Re: Collision detection
« on: October 28, 2010, 09:48:07 am »
That was very helpful.  Thank you.

One more question.  I see I can check if the cube was the target of the collision, using cube.wasTargetOfLastCollision();  How do I check if the sphere has collided with something/anything ?  Without checking every potential target?  Or is this not something that can be polled?  An acceptable use of CollisionEvent perhaps?

Support / Collision detection
« on: October 27, 2010, 12:53:55 pm »
I've been trying out jPCT today, and I can't figure out collision detection.

I started with the hello world for Android example.

I added another shape then moved one shape to collide with the other, and listened for collision.  At least I think so.  I haven't seen any examples or tutorials to do with collision (Can anyone point me to something?).  And I'm just picking out methods from the javaDocs that look like they'll do the trick.

With my two shapes, I do the following:-

Code: [Select]

sphere.translate(20, 0, 0);

Alright, I suspect I don't need to set BOTH shapes up, but I was trying to get it working.

I've implemented CollisionListener, and written:-

Code: [Select]
public void collision(CollisionEvent arg0) {

public boolean requiresPolygonIDs() {
// TODO Auto-generated method stub
return false;

Then within the game loop, I just move the sphere towards the cube...

Code: [Select]

And also tried moving the camera with checkCameraCollisionSpherical/Ellipsoid, but it didn't stop at the obstacle.

I don't understand the way slideMode id described anyway.  Does this mean it will stop at the obstacle, and slide no further?  Or not move (slide) if there is an obstacle in the way?

I know there's a similar scheme for moving an object (instead of using translate).  To stop at an obstacle.  Can anyone point me at an example?

Pages: [1]