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.


Topics - voronwe13

Pages: [1]
1
Support / World.getObject(id) issue
« on: September 10, 2014, 07:24:53 pm »
I'm having an issue where I need to check if a world has a specific object in it, or whether it has been removed from the world.   Essentially, I'm doing:
Code: [Select]
if(world.getObject(object.getID()) == null){
   world.addObject(object);
}

The problem I'm having is that instead of returning null, the app is erroring out with the following message:

java.lang.RuntimeException: [ 1410369008776 ] - ERROR: Can't retrieve object #6!


at the line where I call world.getObject(object.getID());

Am I doing something wrong?

2
Support / RemoveAllObjects and Polylines
« on: September 03, 2014, 08:59:58 pm »
Is there a quick way to remove all polylines from a world?  World.removeAllObjects() doesn't appear to remove polylines, nor even World.removeAll().

3
Support / Object3D.rayIntersectsAABB question
« on: August 08, 2014, 08:56:25 pm »
I'm working on an android application where I need to be able to select objects on screen, and I'm having issues with the collision detection code in Object3D.  This is a 2D image viewing/editing application, so everything is pretty simple shapes, mostly just squares.   My first thought for selecting an item was to use Object3D.rayIntersectsAABB, with the coordinates of the touch point translated to world space as the origin (say [25, 25, -10], a simple vector pointing down towards the plane of the images and objects ([0,0,1]).   The problem is that no matter where I touch, it thinks the ray intersects.   I've confirmed the AABB (using this example, it could be [0,5,0,5,-1,-1]), and it looks accurate to the object.   It seems like it's using the AABB as infinite planes instead of just a box.  If I used the direction vector [0,0,-1], it never intersects, and if I use a direction vector of [0,1,0], it intersects if I touch anywhere other than one side of the box, even though the z value of the touch point should make it not intersect at all.   Is this how the AABB is supposed to work, or am I missing something?

I've also tried using calcMinDistance for checking if it intersects, and this works with some objects, but I have an object that uses a VertexController to change the mesh, and no matter what I've tried, it only detects a hit if I touch somewhere in the object at its original size/shape before any changes from the VertexController.  Is there a way to get it to do hit detection based on the updated mesh?

Thanks for all your help, this forum has been a lifesaver on many occasions!

Pages: [1]