PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: RagdollLoaderPL.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLPHYSICS_SCENENODES_RAGDOLLLOADER_PL_H__ 00024 #define __PLPHYSICS_SCENENODES_RAGDOLLLOADER_PL_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLPhysics/SceneNodes/RagdollLoader.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLPhysics { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * Ragdoll loader implementation for the PixelLight ragdoll XML file format 00046 */ 00047 class RagdollLoaderPL : public RagdollLoader { 00048 00049 00050 //[-------------------------------------------------------] 00051 //[ RTTI interface ] 00052 //[-------------------------------------------------------] 00053 pl_class(PLPHYSICS_RTTI_EXPORT, RagdollLoaderPL, "PLPhysics", PLPhysics::RagdollLoader, "Ragdoll loader implementation for the PixelLight ragdoll XML file format") 00054 // Properties 00055 pl_properties 00056 pl_property("Formats", "ragdoll,RAGDOLL") 00057 pl_property("Load", "1") 00058 pl_property("Save", "1") 00059 pl_properties_end 00060 // Constructors 00061 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00062 // Methods 00063 pl_method_2(Load, pl_ret_type(bool), SNRagdoll&, PLCore::File&, "Load method. By default, attach to world is allowed.", "") 00064 pl_method_3(LoadParams, pl_ret_type(bool), SNRagdoll&, PLCore::File&, bool, "Load method. Parameters: Attach to world allowed state as 'bool'.", "") 00065 pl_method_2(Save, pl_ret_type(bool), SNRagdoll&, PLCore::File&, "Save method", "") 00066 pl_class_end 00067 00068 00069 //[-------------------------------------------------------] 00070 //[ Public RTTI methods ] 00071 //[-------------------------------------------------------] 00072 public: 00073 PLPHYSICS_API bool Load(SNRagdoll &cSNRagdoll, PLCore::File &cFile); 00074 PLPHYSICS_API bool LoadParams(SNRagdoll &cSNRagdoll, PLCore::File &cFile, bool bAllowAttachToWorld); 00075 PLPHYSICS_API bool Save(SNRagdoll &cSNRagdoll, PLCore::File &cFile); 00076 00077 00078 //[-------------------------------------------------------] 00079 //[ Public functions ] 00080 //[-------------------------------------------------------] 00081 public: 00082 /** 00083 * @brief 00084 * Default constructor 00085 */ 00086 PLPHYSICS_API RagdollLoaderPL(); 00087 00088 /** 00089 * @brief 00090 * Destructor 00091 */ 00092 PLPHYSICS_API virtual ~RagdollLoaderPL(); 00093 00094 00095 //[-------------------------------------------------------] 00096 //[ Private functions ] 00097 //[-------------------------------------------------------] 00098 private: 00099 /** 00100 * @brief 00101 * Loader implementation for format version 1 00102 * 00103 * @param[in] cSNRagdoll 00104 * Ragdoll to load into 00105 * @param[in] cRagdollElement 00106 * Ragdoll XML element to read the data from 00107 * @param[in] bAllowAttachToWorld 00108 * Allow attach to world? 00109 * 00110 * @return 00111 * 'true' if all went fine, else 'false' 00112 */ 00113 bool LoadV1(SNRagdoll &cSNRagdoll, const PLCore::XmlElement &cRagdollElement, bool bAllowAttachToWorld) const; 00114 00115 00116 }; 00117 00118 00119 //[-------------------------------------------------------] 00120 //[ Namespace ] 00121 //[-------------------------------------------------------] 00122 } // PLPhysics 00123 00124 00125 #endif // __PLPHYSICS_SCENENODES_RAGDOLLLOADER_PL_H__
|