Ray results

When checking against ray results, I want to exclude anything contained within the node I am check for (i.e. player casts ray, exclude player node and all associated geometry).



This use to work, and now doesn’t in Beta:



[java]if (node.getChild(rayResults.getCollision(i).getGeometry().getName()) == null) {

// do something useful

}[/java]



Suggestions for another way of handling this?

oO Are you loading ogre models directly? I couldn’t think of a way the names changes just like that otherwise… On the other hand, what you do doesn’t seem to make much sense to me right now… You get the name of a geometry that you then again search in the rootNode, which gives you a chance to get the same geometry or maybe some other if it has the same name and check if thats null… Is that really what you want?

I’m converting all models to j3o.



node = the player/npc node… and all names of geoms are unique due to the class I wrote for loading geometries. Basically, I’m wearing gauntlets, your wearing gauntlets. They are both plate gaunts, and therefore have the same geometry loaded (with potentially different textures). When the geometry is loaded, a unique id is created and used for naming the geom. The geom is added to the appropriate node (which is also named using a unique id system).



When I check against the “node” above, it is the player/npc node who is casting the ray (not the root node). Then I iterate through the results, checking against the geometries contained in the player/npc node, until I find the first result that is not a child of the player’s/npc’s node.



I am sure there are many other ways to do this, but I’m just trying to figure out why the code I had written isn’t working anymore. Has something changed in the way this works?

Aaalright, ok… Humm… Nothing has changed about getChild() really, can you check back if the names changed somehow?

When spitting out the ray results, the count is 1 more than owned by the player/npc node and the geometry (by name) is not contained by the player/npc node. However, when I use the above code, it doesn’t see it this way. /boggle In my test, I have a single geom in the player node and a single geom for ground below the player, both are returned in the ray results and both are contained in separate nodes (i.e. the ground is NOT a child of the player)



I feel bad for posting this, as I KNOW it is an issue with my code somewhere and how things are handled in JME. The only reason I brought this here, is I am fairly sure that my other post about Nifty issues is not creating the “things dropping through the world” problem. I assumed that the stall in the render engine from Nifty was creating the problem and apparently that is not the case.



EDIT: Ugh… maybe I jumped the gun here. I am going to turn off gravity and ensure that this is the case. Sorry for the rambling while I beat my head against a wall looking for the issue.

1 Like

@normen /sigh … This might still be related to ATI graphics card issues. I could potentially be chasing ghosts here. When I disable gravity, the collision results seem to work. So something is causing the TPF to be EXTREMELY erratic. When I move the camera around, things are extremely stuttered and geometries appear/disappear depending on the angle of the camera. My assumption is that the erratic TPF is allowing things to drop through the world. As for the render issue, I have no clue what to do about. The update to the lighting frag and vert files stopped the critical error, but it is definitely not working correctly yet (for ATI Radeon cards that is). I guess I need to wait for a fix on this one and stop chasing ghosts.



Thanks a TON for all the effort and help!

1 Like