Panda3D
|
00001 // Filename: physxFixedJoint.cxx 00002 // Created by: enn0x (02Oct09) 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 "physxFixedJoint.h" 00016 #include "physxFixedJointDesc.h" 00017 00018 TypeHandle PhysxFixedJoint::_type_handle; 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: PhysxFixedJoint::link 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 void PhysxFixedJoint:: 00026 link(NxJoint *jointPtr) { 00027 00028 _ptr = jointPtr->isFixedJoint(); 00029 _ptr->userData = this; 00030 _error_type = ET_ok; 00031 00032 set_name(jointPtr->getName()); 00033 00034 PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData; 00035 scene->_joints.add(this); 00036 } 00037 00038 //////////////////////////////////////////////////////////////////// 00039 // Function: PhysxFixedJoint::unlink 00040 // Access: Public 00041 // Description: 00042 //////////////////////////////////////////////////////////////////// 00043 void PhysxFixedJoint:: 00044 unlink() { 00045 00046 _ptr->userData = NULL; 00047 _error_type = ET_released; 00048 00049 PhysxScene *scene = (PhysxScene *)_ptr->getScene().userData; 00050 scene->_joints.remove(this); 00051 } 00052 00053 //////////////////////////////////////////////////////////////////// 00054 // Function : PhysxFixedJoint::save_to_desc 00055 // Access : Published 00056 // Description : Saves the state of the joint object to a 00057 // descriptor. 00058 //////////////////////////////////////////////////////////////////// 00059 void PhysxFixedJoint:: 00060 save_to_desc(PhysxFixedJointDesc &jointDesc) const { 00061 00062 nassertv(_error_type == ET_ok); 00063 _ptr->saveToDesc(jointDesc._desc); 00064 } 00065 00066 //////////////////////////////////////////////////////////////////// 00067 // Function : PhysxFixedJoint::load_from_desc 00068 // Access : Published 00069 // Description : Loads the entire state of the joint from a 00070 // descriptor with a single call. 00071 //////////////////////////////////////////////////////////////////// 00072 void PhysxFixedJoint:: 00073 load_from_desc(const PhysxFixedJointDesc &jointDesc) { 00074 00075 nassertv(_error_type == ET_ok); 00076 _ptr->loadFromDesc(jointDesc._desc); 00077 } 00078