• Advertisement
Sign in to follow this  

PhysX. NxCookTriangleMesh return false

This topic is 3712 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why NxCookTriangleMesh can return false ? Documentation says that NxCookTriangleMesh return true on success.
NxTriangleMeshDesc		heightfieldDesc;
		heightfieldDesc.numVertices		=	33*33;
		heightfieldDesc.numTriangles	=	32*32*2;
		heightfieldDesc.pointStrideBytes	=	sizeof(DHMVertex);
		heightfieldDesc.triangleStrideBytes	=	sizeof(DIndex)	*	3;
		heightfieldDesc.points				=	chunk;
		heightfieldDesc.triangles			=	indices;
		heightfieldDesc.flags				=	NX_MF_HARDWARE_MESH;

		heightfieldDesc.heightFieldVerticalAxis	=	NX_Z;
		heightfieldDesc.heightFieldVerticalExtent	=	-1000;

		NxTriangleMeshShapeDesc	heightfieldShapeDesc;
		bool	cookInited = NxInitCooking();

		MemoryWriteBuffer	stream;

		bool	status = NxCookTriangleMesh(heightfieldDesc,stream);
chunk and indices are valid pointers.

Share this post


Link to post
Share on other sites
Advertisement
Problem solved.
My indices was 16 bit, and it's need to set flag NX_MF_16_BIT_INDICES to NxTriangleMeshDesc

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement