Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I just finished adding a new API that picks up the closest node from the Active camera centre view. It firstly uses a fast bounding box detection before finding the closest node based on actual mesh triangles and work for all scene nodes including terrain. Its very fast and very accurate so happy with the results - you only need to enter the maximum distance from the camera to return thye closest node it finds within that distance. I will updated itchio in a day or so.... |
||||
|
That's a handy idea. In my custom implementation, I use a slightly more complex system (ccbGetSceneNodeFromLine(startX, startY, startZ, endX, endY, endZ)), where I check for mesh intersection similarly to the original function (ccbGetCollisionPointOfWorldWithLine), but then I also verify which mesh it belongs to and return the node. It's also a very convenient way to retrieve the node. But I also use ccbGetSceneNodeFromRay additionally, where I get the node via the bounding box instead of mesh intersection, which is relatively faster. However, it returns everything from mesh nodes to billboard nodes and animators. It basically has two parameter variations: (node, startX, startY, startZ, endX, endY, endZ) and just (startX, startY, startZ, endX, endY, endZ), where you can include a node to skip. This is useful because sometimes you need to ignore a specific node - for example, in an FPS, you might need to skip the hand model in front of the camera, or in similar scenarios. Overall, your implementation with a simple distance check is a very interesting solution! |
||||
|
Cheers Wing - its my best way yet to get accurate node detection and automated to work from the active camera centre - which is what most people need to use for it I think. Itchio is now updated: https://robo25.itch.io/coppercube-apis-version-2 See a short YouTube video also: https://youtu.be/I8mGHHxPyoE My new Timer system now is able to show fractions of a millisecond for performance debugging also. (using new chrono library) |
||||
|
Not the best spot to mention this but if using "ccbSetCrossFade" please change to "ccbSetCrossFadeAlpha" as there is also available: "ccbSetCrossFadeAdd". ie one uses 'transparent alpha' and the other 'transparent add' material. |
||||
|
This look way better and more accurate than when I do a line pick. Not to be greedy , but could you add a variable that would let it pic downwards from any object?. You probably already realized im wanting to do drop shadows . Currently it will work , but even if just testing a z of 2 or 3 it will pass through some geometry like a bridge or raised surface. I can just give the shadow its own collision. Then ofcourse it gets caught sometimes even if using position node without collision. Im not sure if hadokens ray cast would work for this. I keep forgetting to look into it. Lol Anyways, this is cool and very fast robo, thanks for the update and all your work. Hopefully you'll be able to get some work done on your game soon. Looking forward to it. Sam |
||||
|
Hi Sam, Good idea actually to make the same but directly below the player as if only using bounding boxes might not get the closest mesh to the player as the distance used is the middle of the bounding box and some bounding boxes are much bigger than others. Have a go for interest sake first at using my API - ccbGetImpactNode(); which only looks below the player actually to get the closest node. Then compare the result to ccbGetCollisionPointOfWorldWithLine API to see if there are any differences to the node from the first one to the position of the 2nd one...be interested to know. If no good then I will consider a new API for directly below the player only. Let me know... |
||||
|
|