Panda3D
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Enumerations
panda
src
physx
physxSoftBodyMesh.cxx
1
// Filename: physxSoftBodyMesh.cxx
2
// Created by: enn0x (12Sep10)
3
//
4
////////////////////////////////////////////////////////////////////
5
//
6
// PANDA 3D SOFTWARE
7
// Copyright (c) Carnegie Mellon University. All rights reserved.
8
//
9
// All use of this software is subject to the terms of the revised BSD
10
// license. You should have received a copy of this license along
11
// with this source code in a file named "LICENSE."
12
//
13
////////////////////////////////////////////////////////////////////
14
15
#include "physxSoftBodyMesh.h"
16
#include "physxMeshPool.h"
17
18
TypeHandle
PhysxSoftBodyMesh::_type_handle;
19
20
////////////////////////////////////////////////////////////////////
21
// Function: PhysxSoftBodyMesh::link
22
// Access: Public
23
// Description:
24
////////////////////////////////////////////////////////////////////
25
void
PhysxSoftBodyMesh::
26
link(NxSoftBodyMesh *meshPtr) {
27
28
// Link self
29
PhysxManager::get_global_ptr
()->_softbody_meshes.add(
this
);
30
_ptr = meshPtr;
31
_error_type = ET_ok;
32
}
33
34
////////////////////////////////////////////////////////////////////
35
// Function: PhysxSoftBodyMesh::unlink
36
// Access: Public
37
// Description:
38
////////////////////////////////////////////////////////////////////
39
void
PhysxSoftBodyMesh::
40
unlink() {
41
42
// Unlink self
43
_error_type = ET_released;
44
PhysxManager::get_global_ptr
()->_softbody_meshes.remove(
this
);
45
}
46
47
////////////////////////////////////////////////////////////////////
48
// Function: PhysxSoftBodyMesh::release
49
// Access: Published
50
// Description:
51
////////////////////////////////////////////////////////////////////
52
void
PhysxSoftBodyMesh::
53
release() {
54
55
nassertv(_error_type == ET_ok);
56
57
unlink();
58
NxGetPhysicsSDK()->releaseSoftBodyMesh(*_ptr);
59
_ptr = NULL;
60
61
PhysxMeshPool::release_soft_body_mesh(
this
);
62
}
63
64
////////////////////////////////////////////////////////////////////
65
// Function: PhysxSoftBodyMesh::get_reference_count
66
// Access: Published
67
// Description: Returns the reference count for shared meshes.
68
////////////////////////////////////////////////////////////////////
69
unsigned
int
PhysxSoftBodyMesh::
70
get_reference_count
()
const
{
71
72
nassertr(_error_type == ET_ok, 0);
73
74
return
_ptr->getReferenceCount();
75
}
76
PhysxManager::get_global_ptr
static PhysxManager * get_global_ptr()
Returns a pointer to the global PhysxManager object.
Definition:
physxManager.cxx:104
PhysxSoftBodyMesh::get_reference_count
unsigned int get_reference_count() const
Returns the reference count for shared meshes.
Definition:
physxSoftBodyMesh.cxx:70
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition:
typeHandle.h:85
Generated on Mon Feb 1 2016 13:44:36 for Panda3D by
1.8.5