Panda3D

physxVehicle.cxx

00001 // Filename: physxVehicle.cxx
00002 // Created by:  enn0x (23Mar10)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "physxVehicle.h"
00016 #include "physxActor.h"
00017 #include "physxWheel.h"
00018 #include "physxScene.h"
00019 
00020 TypeHandle PhysxVehicle::_type_handle;
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //     Function: PhysxVehicle::create
00024 //       Access: Public
00025 //  Description: 
00026 ////////////////////////////////////////////////////////////////////
00027 void PhysxVehicle::
00028 create(PhysxScene *scene, PhysxVehicleDesc &desc) {
00029 
00030   nassertv(_error_type == ET_empty);
00031 
00032   _scene = scene;
00033 
00034   // TODO !!!
00035 
00036   _error_type = ET_ok;
00037   _scene->_vehicles.add(this);
00038 }
00039 
00040 ////////////////////////////////////////////////////////////////////
00041 //     Function: PhysxVehicle::release
00042 //       Access: Published
00043 //  Description: Destroys this vehicle.
00044 ////////////////////////////////////////////////////////////////////
00045 void PhysxVehicle::
00046 release() {
00047 
00048   nassertv(_error_type == ET_ok);
00049 
00050   _error_type = ET_released;
00051   _scene->_vehicles.remove(this);
00052 }
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 //     Function: PhysxVehicle::update_vehicle
00056 //       Access: Public
00057 //  Description: 
00058 ////////////////////////////////////////////////////////////////////
00059 void PhysxVehicle::
00060 update_vehicle(float dt) {
00061 
00062   nassertv(_error_type == ET_ok);
00063 
00064   // TODO !!!
00065 }
00066 
00067 /*
00068 ////////////////////////////////////////////////////////////////////
00069 //     Function: PhysxVehicle::get_actor
00070 //       Access: Published
00071 //  Description: Returns the actor for this vehicle.
00072 ////////////////////////////////////////////////////////////////////
00073 PhysxActor *PhysxVehicle::
00074 get_actor() const {
00075 
00076   nassertr(_error_type == ET_ok, NULL);
00077   return _actor;
00078 }
00079 */
00080 
00081 /*
00082 ////////////////////////////////////////////////////////////////////
00083 //     Function: PhysxVehicle::get_num_wheels
00084 //       Access: Published
00085 //  Description: Returns the number of wheels on this vehicle.
00086 ////////////////////////////////////////////////////////////////////
00087 unsigned int PhysxVehicle::
00088 get_num_wheels() const {
00089 
00090   nassertr(_error_type == ET_ok, 0);
00091   return _wheels.size();
00092 }
00093 
00094 ////////////////////////////////////////////////////////////////////
00095 //     Function: PhysxVehicle::get_wheel
00096 //       Access: Published
00097 //  Description: Returns the n-th wheel of this vehicle.
00098 ////////////////////////////////////////////////////////////////////
00099 PhysxWheel *PhysxVehicle::
00100 get_wheel(unsigned int idx) const {
00101 
00102   nassertr(_error_type == ET_ok, NULL);
00103   return _wheels[idx];
00104 }
00105 */
00106 
 All Classes Functions Variables Enumerations