Panda3D
Loading...
Searching...
No Matches
physxClothMesh.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file physxClothMesh.cxx
10 * @author enn0x
11 * @date 2010-03-28
12 */
13
14#include "physxClothMesh.h"
15#include "physxMeshPool.h"
16
17TypeHandle PhysxClothMesh::_type_handle;
18
19/**
20 *
21 */
22void PhysxClothMesh::
23link(NxClothMesh *meshPtr) {
24
25 // Link self
26 PhysxManager::get_global_ptr()->_cloth_meshes.add(this);
27 _ptr = meshPtr;
28 _error_type = ET_ok;
29}
30
31/**
32 *
33 */
34void PhysxClothMesh::
35unlink() {
36
37 // Unlink self
38 _error_type = ET_released;
39 PhysxManager::get_global_ptr()->_cloth_meshes.remove(this);
40}
41
42/**
43 *
44 */
45void PhysxClothMesh::
46release() {
47
48 nassertv(_error_type == ET_ok);
49
50 unlink();
51 NxGetPhysicsSDK()->releaseClothMesh(*_ptr);
52 _ptr = nullptr;
53
54 PhysxMeshPool::release_cloth_mesh(this);
55}
56
57/**
58 * Returns the reference count for shared meshes.
59 */
60unsigned int PhysxClothMesh::
61get_reference_count() const {
62
63 nassertr(_error_type == ET_ok, 0);
64
65 return _ptr->getReferenceCount();
66}
unsigned int get_reference_count() const
Returns the reference count for shared meshes.
static PhysxManager * get_global_ptr()
Returns a pointer to the global PhysxManager object.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.