Panda3D

Loading...
Searching...
No Matches
Public Member Functions | List of all members
PhysxClothMeshDesc Class Reference

## Public Member Functions
const NxClothMeshDesc & | get_desc () const
const plist< LPoint2f > | get_texcoords () const
bool | is_valid () const
| Returns true if the descriptor is valid.
void | set_from_node_path (const NodePath &np)
| A convenience method to set the mesh data from a NodePath in a single call.
void | set_num_triangles (unsigned int n)
| Sets the number of triangles to be stored in this triangle mesh.
void | set_num_vertices (unsigned int n)
| Sets the number of vertices to be stored within this triangle mesh.
void | set_triangle (unsigned int idx, unsigned int i1, unsigned int i2, unsigned int i3)
| Sets a single triangle, by providing the three indices i1, i2, i3.
void | set_vertex (unsigned int idx, const LPoint3f &vert, const LPoint2f &texcoord)
| Sets a single vertex.

## Detailed Description

Definition at line 27 of file physxClothMeshDesc.h.

## Constructor & Destructor Documentation

## ◆ PhysxClothMeshDesc()

PhysxClothMeshDesc::PhysxClothMeshDesc | ( |  | ) |
| inline

Definition at line 17 of file physxClothMeshDesc.I.

## ◆ ~PhysxClothMeshDesc()

PhysxClothMeshDesc::~PhysxClothMeshDesc | ( |  | ) |
| inline

Definition at line 34 of file physxClothMeshDesc.I.

## Member Function Documentation

## ◆ get_desc()

const NxClothMeshDesc & PhysxClothMeshDesc::get_desc | ( |  | ) | const
| inline

Definition at line 62 of file physxClothMeshDesc.I.

## ◆ get_texcoords()

const plist< LPoint2f > PhysxClothMeshDesc::get_texcoords | ( |  | ) | const
| inline

Definition at line 71 of file physxClothMeshDesc.I.

## ◆ is_valid()

bool PhysxClothMeshDesc::is_valid | ( |  | ) | const
| inline

Returns true if the descriptor is valid.

Definition at line 53 of file physxClothMeshDesc.I.

## ◆ set_from_node_path()

void PhysxClothMeshDesc::set_from_node_path | ( | const NodePath & | np | ) |

A convenience method to set the mesh data from a NodePath in a single call.

The method iterates over the NodePath geoms and collects data for the triangle mesh.

Do not use the following function when using this one: - set_num_vertices - set_vertex - set_num_triangles - set_triangle

Definition at line 103 of file physxClothMeshDesc.cxx.

References NodePath::find_all_matches(), GeomVertexReader::get_data2f(), GeomVertexReader::get_data3f(), GeomNode::get_num_geoms, NodePathCollection::get_num_paths, NodePathCollection::get_path, GeomVertexReader::is_at_end(), NodePath::node(), and PhysxManager::point3_to_nxVec3().

## ◆ set_num_triangles()

void PhysxClothMeshDesc::set_num_triangles | ( | unsigned int | numTriangles | ) |

Sets the number of triangles to be stored in this triangle mesh.

This method must be called before any calls to set_triangle are done!

Definition at line 67 of file physxClothMeshDesc.cxx.

## ◆ set_num_vertices()

void PhysxClothMeshDesc::set_num_vertices | ( | unsigned int | numVertices | ) |

Sets the number of vertices to be stored within this triangle mesh.

The function allocates memory for the vertices, but it does not set any vertices.

This method must be called before any calls to set_vertex are done!

Definition at line 28 of file physxClothMeshDesc.cxx.

## ◆ set_triangle()

void PhysxClothMeshDesc::set_triangle | ( | unsigned int | idx,
|  | unsigned int | i1,
|  | unsigned int | i2,
|  | unsigned int | i3 )

Sets a single triangle, by providing the three indices i1, i2, i3.

Definition at line 83 of file physxClothMeshDesc.cxx.

## ◆ set_vertex()

void PhysxClothMeshDesc::set_vertex | ( | unsigned int | idx,
|  | const LPoint3f & | vert,
|  | const LPoint2f & | texcoord )

Sets a single vertex.

You have to call the function set_num_vertices before you can call this function.

Definition at line 53 of file physxClothMeshDesc.cxx.

References PhysxManager::point3_to_nxVec3().

The documentation for this class was generated from the following files:

- panda/src/physx/physxClothMeshDesc.h
- panda/src/physx/physxClothMeshDesc.cxx
- panda/src/physx/physxClothMeshDesc.I