Panda3D
 All Classes Functions Variables Enumerations
physxVehicle.cxx
1 // Filename: physxVehicle.cxx
2 // Created by: enn0x (23Mar10)
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 "physxVehicle.h"
16 #include "physxActor.h"
17 #include "physxWheel.h"
18 #include "physxScene.h"
19 
20 TypeHandle PhysxVehicle::_type_handle;
21 
22 ////////////////////////////////////////////////////////////////////
23 // Function: PhysxVehicle::create
24 // Access: Public
25 // Description:
26 ////////////////////////////////////////////////////////////////////
27 void PhysxVehicle::
28 create(PhysxScene *scene, PhysxVehicleDesc &desc) {
29 
30  nassertv(_error_type == ET_empty);
31 
32  _scene = scene;
33 
34  // TODO !!!
35 
36  _error_type = ET_ok;
37  _scene->_vehicles.add(this);
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: PhysxVehicle::release
42 // Access: Published
43 // Description: Destroys this vehicle.
44 ////////////////////////////////////////////////////////////////////
45 void PhysxVehicle::
47 
48  nassertv(_error_type == ET_ok);
49 
50  _error_type = ET_released;
51  _scene->_vehicles.remove(this);
52 }
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function: PhysxVehicle::update_vehicle
56 // Access: Public
57 // Description:
58 ////////////////////////////////////////////////////////////////////
59 void PhysxVehicle::
60 update_vehicle(float dt) {
61 
62  nassertv(_error_type == ET_ok);
63 
64  // TODO !!!
65 }
66 
67 /*
68 ////////////////////////////////////////////////////////////////////
69 // Function: PhysxVehicle::get_actor
70 // Access: Published
71 // Description: Returns the actor for this vehicle.
72 ////////////////////////////////////////////////////////////////////
73 PhysxActor *PhysxVehicle::
74 get_actor() const {
75 
76  nassertr(_error_type == ET_ok, NULL);
77  return _actor;
78 }
79 */
80 
81 /*
82 ////////////////////////////////////////////////////////////////////
83 // Function: PhysxVehicle::get_num_wheels
84 // Access: Published
85 // Description: Returns the number of wheels on this vehicle.
86 ////////////////////////////////////////////////////////////////////
87 unsigned int PhysxVehicle::
88 get_num_wheels() const {
89 
90  nassertr(_error_type == ET_ok, 0);
91  return _wheels.size();
92 }
93 
94 ////////////////////////////////////////////////////////////////////
95 // Function: PhysxVehicle::get_wheel
96 // Access: Published
97 // Description: Returns the n-th wheel of this vehicle.
98 ////////////////////////////////////////////////////////////////////
99 PhysxWheel *PhysxVehicle::
100 get_wheel(unsigned int idx) const {
101 
102  nassertr(_error_type == ET_ok, NULL);
103  return _wheels[idx];
104 }
105 */
106 
A scene is a collection of bodies, constraints, and effectors which can interact. ...
Definition: physxScene.h:73
void release()
Destroys this vehicle.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85