![]() ![]() |
Nov 5 2009, 10:48 PM
Post
#1
|
|
|
Member ![]() ![]() Group: Members Posts: 6 Joined: 3-November 09 Member No.: 9,747 |
There is some way to determine the vertices of the meshs of a actor?
|
|
|
|
Nov 6 2009, 05:07 AM
Post
#2
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 54 Joined: 18-April 08 From: New Zealand Member No.: 5,024 |
When you say 'meshs of a actor', do you mean any NxTriangleMeshShape or NxConvexShape shapes on an actor?
If so; Get the shape(s): actor->getShapes()[ x ] Cast it to the right type For triangle mesh shape; Call triangleMesh = shape.getTriangleMesh() Then desc = triangleMesh.saveToDesc Then iterate from 0 to desc.numVertices-1, and call NxVec3* vertex = ((NxVec3*)desc.points)[ i ] to get each vertex position. Don't forget about the point stride size Same deal for convex mesh |
|
|
|
Nov 6 2009, 03:08 PM
Post
#3
|
|
|
Member ![]() ![]() Group: Members Posts: 6 Joined: 3-November 09 Member No.: 9,747 |
When you say 'meshs of a actor', do you mean any NxTriangleMeshShape or NxConvexShape shapes on an actor? If so; Get the shape(s): actor->getShapes()[ x ] Cast it to the right type For triangle mesh shape; Call triangleMesh = shape.getTriangleMesh() Then desc = triangleMesh.saveToDesc Then iterate from 0 to desc.numVertices-1, and call NxVec3* vertex = ((NxVec3*)desc.points)[ i ] to get each vertex position. Don't forget about the point stride size Same deal for convex mesh Thanks stillDesign! It's a NxConvexShape. I got to obtain the points. But, the points returned of the vertices are local to the actor. How i can to translate from local points to global points in the space?? |
|
|
|
Nov 14 2009, 12:04 AM
Post
#4
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 54 Joined: 18-April 08 From: New Zealand Member No.: 5,024 |
Thanks stillDesign! It's a NxConvexShape. I got to obtain the points. But, the points returned of the vertices are local to the actor. How i can to translate from local points to global points in the space?? True, To transform the points to an actors global space, just multiply each point by the actors global pose: foreach point Vec3 worldPoint = Vec3.Transform(point, actor->getGlobalPose() ) |
|
|
|
![]() ![]() |
|
Copyright © 2008 NVIDIA® Corporation. Terms of Use | Legal Info | Privacy Policy | Time is now: 24th November 2009 - 01:28 AM |