Panda3D
physxJointDriveDesc.cxx
1 // Filename: physxJointDriveDesc.cxx
2 // Created by: enn0x (01Oct09)
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 "physxJointDriveDesc.h"
16 
17 ////////////////////////////////////////////////////////////////////
18 // Function: PhysxJointDriveDesc::spring
19 // Access: Published
20 // Description:
21 ////////////////////////////////////////////////////////////////////
22 void PhysxJointDriveDesc::
23 set_spring(float spring) {
24 
25  _desc.spring = spring;
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: PhysxJointDriveDesc::set_damping
30 // Access: Published
31 // Description:
32 ////////////////////////////////////////////////////////////////////
33 void PhysxJointDriveDesc::
34 set_damping(float damping) {
35 
36  _desc.damping = damping;
37 }
38 
39 ////////////////////////////////////////////////////////////////////
40 // Function: PhysxJointDriveDesc::set_force_limit
41 // Access: Published
42 // Description:
43 ////////////////////////////////////////////////////////////////////
44 void PhysxJointDriveDesc::
45 set_force_limit(float forceLimit) {
46 
47  _desc.forceLimit = forceLimit;
48 }
49 
50 ////////////////////////////////////////////////////////////////////
51 // Function: PhysxJointDriveDesc::set_drive_type
52 // Access: Published
53 // Description:
54 ////////////////////////////////////////////////////////////////////
55 void PhysxJointDriveDesc::
56 set_drive_type(PhysxD6JointDriveType driveType) {
57 
58  _desc.driveType = (NxD6JointDriveType)driveType;
59 }
60 
61 ////////////////////////////////////////////////////////////////////
62 // Function: PhysxJointDriveDesc::get_spring
63 // Access: Published
64 // Description:
65 ////////////////////////////////////////////////////////////////////
66 float PhysxJointDriveDesc::
67 get_spring() const {
68 
69  return _desc.spring;
70 }
71 
72 ////////////////////////////////////////////////////////////////////
73 // Function: PhysxJointDriveDesc::get_damping
74 // Access: Published
75 // Description:
76 ////////////////////////////////////////////////////////////////////
77 float PhysxJointDriveDesc::
78 get_damping() const {
79 
80  return _desc.damping;
81 }
82 
83 ////////////////////////////////////////////////////////////////////
84 // Function: PhysxJointDriveDesc::get_force_limit
85 // Access: Published
86 // Description:
87 ////////////////////////////////////////////////////////////////////
88 float PhysxJointDriveDesc::
89 get_force_limit() const {
90 
91  return _desc.forceLimit;
92 }
93 
94 ////////////////////////////////////////////////////////////////////
95 // Function: PhysxJointDriveDesc::get_drive_type
96 // Access: Published
97 // Description:
98 ////////////////////////////////////////////////////////////////////
99 PhysxEnums::PhysxD6JointDriveType PhysxJointDriveDesc::
100 get_drive_type() const {
101 
102  return (PhysxD6JointDriveType)_desc.driveType.bitField;
103 }
104