hi,
again, i’ve a question.
I’m using a behavior using 'WakeupOnCollisionEntry, it works but it “wakes up” for any collision, with any shape.
I thought only the nodes with ENABLE_COLLISION_REPORTING capability would, could raise the criterion, but it doesn’t seem to be the case.
Does anyone knows how to avoid collision reporting from certain nodes?
thanks
nobody?
damn, are there only niewbies around here or what? ??? It seems like no one ever needed to detect collision!
Don’t know if this will help you, but from the JavaDocs:
[quote]ENABLE_COLLISION_REPORTING
public static final int ENABLE_COLLISION_REPORTING
Specifies that this Node will be reported in the collision SceneGraphPath if a collision occurs. This capability is only specifiable for Group nodes; it is ignored for leaf nodes. The default for Group nodes is false. All interior nodes not needed for uniqueness in a SceneGraphPath that don’t have ENABLE_COLLISION_REPORTING set to true will not be reported in the SceneGraphPath.
See Also:
SceneGraphPath
[/quote]
[quote]public class SceneGraphPath
extends java.lang.Object
A SceneGraphPath object represents the path from a Locale to a terminal node in the scene graph. This path consists of a Locale, a terminal node, and an array of internal nodes that are in the path from the Locale to the terminal node. The terminal node may be either a Leaf node or a Group node. A valid SceneGraphPath must uniquely identify a specific instance of the terminal node. For nodes that are not under a SharedGroup, the minimal SceneGraphPath consists of the Locale and the terminal node itself. For nodes that are under a SharedGroup, the minimal SceneGraphPath consists of the Locale, the terminal node, and a list of all Link nodes in the path from the Locale to the terminal node. A SceneGraphPath may optionally contain other interior nodes that are in the path. A SceneGraphPath is verified for correctness and uniqueness when it is sent as an argument to other methods of Java 3D.
In the array of internal nodes, the node at index 0 is the node closest to the Locale. The indices increase along the path to the terminal node, with the node at index length-1 being the node closest to the terminal node. The array of nodes does not contain either the Locale (which is not a node) or the terminal node.
When a SceneGraphPath is returned from the picking or collision methods of Java 3D, it will also contain the value of the LocalToVworld transform of the terminal node that was in effect at the time the pick or collision occurred. Note that ENABLE_PICK_REPORTING and ENABLE_COLLISION_REPORTING are disabled by default. This means that the picking and collision methods will return the minimal SceneGraphPath by default.
[/quote]
Don’t know if any of this is new to you, but it might jog someone’s memory…
I don’t think there are only newbies here…rather it might be that majority figured already collision behavior is basically useless for detecting collision since it reports only when collision already happened. PickSegment approach is AFAK the only way to make it work - meaning: …find out that collision is about to happened and make whatever evasive action …
Thank you both for the replies, even if i’m still stuck :-/.
Daath: in fact, i’m pretty pleased with the collision detection, even if it “only” detects when the collision occurs. All the movements are smooth enough. Anyway, it’s performant and i think i couldn’t write a better one (for general collisions).
cfmdobbie: hmm… yeah, this is like light ray. It is not said that the collision won’t be reported but that it won’t be included in the collision SceneGraphPath… slightly different.
:-/ :-/ :-/ damn!
…i’ll try something else…