Odd question

I create a sphere, I give it a location, but do not add it to the scene graph.



Can I still use .getWorldBound().contains(someVector3f); ?



Or do I have to add it to the scene graph to use the world bound?



Thanks!

Hello!



Not 100% certain, but I think it would have to be part of the scene graph to get the world bounds. Though, this raises a question as to why you need to do this? If you need a sphere just for it’s bounds, just create a bounding sphere and work with that. It will be invisible to the player as long as you don’t make it visible with a debug shape.



~FlaH

How about just try it? :stuck_out_tongue:

Implementation to test that should only take a few mins I think, and I actually want to know the answer too =]

tehflah said:
Though, this raises a question as to why you need to do this?


Eval on the server only... I am not using JME Physics classes, so I am not sure if I have access to GhostControl or not.

I would prefer to check if a vector3f is inside of an area without having to add anything to the scene graph, seeing as it will be removed once the eval is complete. This eval is for non-persistent effect areas. Also, there is a potential delay due to using Callables.

I guess I could use a distance check from point of origin, but I was hoping there was a provided solution in JME3 already. Besides, a distance check would only work for a sphere.

baalgarnaal said:
How about just try it? :P
Implementation to test that should only take a few mins I think, and I actually want to know the answer too =]


Just wanted to check to see if anyone had an alternate solution before going through the effort. Though I will test a few idea and see if I can find an acceptable solution :)

Hello again!



The bounding volume and collision classes are not part of Bullet physics. They are standard BiH collision algorithms used for point calculations and intersections. So what I’m getting at is a Bounding Sphere around your thing or whatever you’re testing for, and you just check for intersections? This is not jBullet at all :stuck_out_tongue:



[java]

BoundingSphere boundSphere = new BoundingSphere(radius, position);

[/java]



And then do whatever you need to do with intersects. That’s my guess anyway. I don’t think you even need to attach this to the scenegraph.



Cheers!

~FlaH

1 Like
tehflah said:
Hello again!

The bounding volume and collision classes are not part of Bullet physics. They are standard BiH collision algorithms used for point calculations and intersections. So what I'm getting at is a Bounding Sphere around your thing or whatever you're testing for, and you just check for intersections? This is not jBullet at all :p

[java]
BoundingSphere boundSphere = new BoundingSphere(radius, position);
[/java]

And then do whatever you need to do with intersects. That's my guess anyway. I don't think you even need to attach this to the scenegraph.

Cheers!
~FlaH


Perfect... thanks. This is exactly what I was looking for. I'll give it a shot and see if it works without attaching it (which it looks like it should).

I did a check using a BoundingSphere without adding it to the scene graph and it worked great.

Hello again!



Excellent! There are other bounding volumes you can use also, but the BoundingSphere one seems to get the most use from me. The Box one is aligned on the axis so it’s a little strange to use for some things.



Cheers!

~FlaH