- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FCDocument/FCDPhysicsScene.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00008 /*
    00009     Based on the FS Import classes:
    00010     Copyright (C) 2005-2006 Feeling Software Inc
    00011     Copyright (C) 2005-2006 Autodesk Media Entertainment
    00012     MIT License: http://www.opensource.org/licenses/mit-license.php
    00013 */
    00014
    00020 #ifndef _FCD_PHYSICS_SCENE_NODE_
    00021 #define _FCD_PHYSICS_SCENE_NODE_
    00022
    00023 #ifndef _FCD_ENTITY_H_
    00024 #include "FCDocument/FCDEntity.h"
    00025 #endif // _FCD_ENTITY_H_
    00026
    00027 class FCDocument;
    00028 class FCDEntityInstance;
    00029 class FCDExtra;
    00030 class FCDPhysicsModel;
    00031 class FCDPhysicsModelInstance;
    00032 class FCDForceField;
    00033 class FCDPhysicsForceFieldInstance;
    00034
    00035 typedef FUObjectContainer<FCDPhysicsModelInstance> FCDPhysicsModelInstanceContainer;
    00036 typedef FUObjectContainer<FCDPhysicsForceFieldInstance> FCDForceFieldInstanceContainer;
    00045 class FCOLLADA_EXPORT FCDPhysicsScene : public FCDEntity
    00046 {
    00047 private:
    00048     DeclareObjectType(FCDEntity);
    00049     FMVector3 gravity;
    00050     float timestep;
    00051     FCDPhysicsModelInstanceContainer physicsModelInstances;
    00052     FCDForceFieldInstanceContainer forceFieldInstances;
    00053
    00054 public:
    00059     FCDPhysicsScene(FCDocument* document);
    00060
    00062     virtual ~FCDPhysicsScene();
    00063
    00067     virtual Type GetType() const { return PHYSICS_SCENE_NODE; }
    00068
    00072     FCDPhysicsModelInstanceContainer& GetPhysicsModelInstances() { return physicsModelInstances; }
    00073     const FCDPhysicsModelInstanceContainer& GetPhysicsModelInstances() const { return physicsModelInstances; }
    00078     size_t GetPhysicsModelInstancesCount() const { return physicsModelInstances.size(); };
    00079
    00084     FCDPhysicsModelInstance* GetPhysicsModelInstance(size_t index) { FUAssert(index < GetPhysicsModelInstancesCount(), return NULL); return physicsModelInstances.at(index); }
    00085     const FCDPhysicsModelInstance* GetPhysicsModelInstance(size_t index) const { FUAssert(index < GetPhysicsModelInstancesCount(), return NULL); return physicsModelInstances.at(index); }
    00090     FCDForceFieldInstanceContainer& GetForceFieldInstances() { return forceFieldInstances; }
    00091     const FCDForceFieldInstanceContainer& GetForceFieldInstances() const { return forceFieldInstances; }
    00096     size_t GetForceFieldInstancesCount() const { return forceFieldInstances.size(); };
    00097
    00102     FCDPhysicsForceFieldInstance* GetForceFieldInstance(size_t index) { FUAssert(index < GetForceFieldInstancesCount(), return NULL); return forceFieldInstances.at(index); }
    00103     const FCDPhysicsForceFieldInstance* GetForceFieldInstance(size_t index) const { FUAssert(index < GetForceFieldInstancesCount(), return NULL); return forceFieldInstances.at(index); }
    00110     FCDPhysicsModelInstance* AddPhysicsModelInstance(FCDPhysicsModel* model = NULL);
    00111
    00116     FCDPhysicsForceFieldInstance* AddForceFieldInstance(FCDForceField* forceField = NULL);
    00117
    00121     const FMVector3& GetGravity() const { return gravity; }
    00122
    00125     void SetGravity(const FMVector3& _gravity) { gravity = _gravity; SetDirtyFlag(); }
    00126
    00129     const float& GetTimestep() const { return timestep; }
    00130
    00133     void SetTimestep(float _timestep) { timestep = _timestep; SetDirtyFlag(); }
    00134
    00142     virtual FCDEntity* Clone(FCDEntity* clone = NULL, bool cloneChildren = false) const;
    00143
    00147     virtual void CleanSubId();
    00148 };
    00149
    00150 #endif // _FCD_SCENE_NODE_