Changeset 3342

Show
Ignore:
Timestamp:
01/31/10 14:35:40 (7 weeks ago)
Author:
Azaezel
Message:

adds min/max parameters to PhysicsZone::PhysicsZone? and PhysicsService::createZone

Location:
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsService.cpp

    r3339 r3342  
    5252//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    5353PhysicsService::pPhysicsZone_type 
    54 PhysicsService::createZone(void) 
     54PhysicsService::createZone(const Math::Vector3& _min, const Math::Vector3& _max) 
    5555{ 
    5656    // TODO evaluate whether or not we should have an unregister function for removing worlds from the list. 
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsService.hpp

    r3292 r3342  
    5454    /// @{ 
    5555public: 
    56     virtual pPhysicsZone_type createZone(void); 
     56    virtual pPhysicsZone_type createZone(const Math::Vector3& _min, const Math::Vector3& _max); 
    5757        virtual void stepSimulation(double _elapsedTime); 
    5858    /// @} 
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsZone.cpp

    r3329 r3342  
    4242//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    4343//refnote: http://bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World 
    44 PhysicsZone::PhysicsZone() 
    45 :   m_pScriptModule(Engine::Physics::I_PhysicsManager::getSingleton().getDefaultScriptModule()) 
     44PhysicsZone::PhysicsZone(const Math::Vector3& _min, const Math::Vector3& _max) 
     45:   I_PhysicsZone(_min,_max) 
     46,   m_pScriptModule(Engine::Physics::I_PhysicsManager::getSingleton().getDefaultScriptModule()) 
    4647,   m_pScriptObject(NULL) 
    4748{ 
     
    100101//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    101102void 
    102 PhysicsZone::setZoneSize(const Math::Vector3& _min, const Math::Vector3& _max) 
    103 { 
    104         // set the size of the world 
    105     NewtonSetWorldSize(m_pZone, _min.m_array, _max.m_array);  
    106 } 
    107  
    108 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    109 void 
    110103PhysicsZone::setGravity(const Math::Vector3& _grav) 
    111104{ 
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsZone.hpp

    r3322 r3342  
    7676public: 
    7777    virtual int getDefaultMaterialID(); 
    78     virtual void setZoneSize(const Math::Vector3& _min, const Math::Vector3& _max); 
    7978    virtual void setGravity(const Math::Vector3& _grav); 
    8079    virtual pPhysicsActor_type createActor(); 
     
    153152    /// @{ 
    154153public: 
    155              PhysicsZone(); 
     154             PhysicsZone(const Math::Vector3& _min, const Math::Vector3& _max); 
    156155    virtual ~PhysicsZone(); 
    157156    /// @} 
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZNewton/src/PhysicsService.cpp

    r3294 r3342  
    3131#include <iostream> 
    3232 
     33 
    3334//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    3435namespace Zen { 
     
    3738PhysicsService::PhysicsService() 
    3839{ 
     40 
    3941} 
    4042 
     
    4749//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    4850PhysicsService::pPhysicsZone_type 
    49 PhysicsService::createZone(void) 
     51PhysicsService::createZone(const Math::Vector3& _min, const Math::Vector3& _max) 
    5052{ 
    5153    // TODO evaluate whether or not we should have an unregister function for removing worlds from the list. 
    5254 
    53     PhysicsZone* pRawZone = new PhysicsZone(); 
     55    PhysicsZone* pRawZone = new PhysicsZone(_min,_max); 
    5456    pPhysicsZone_type pZone = pPhysicsZone_type(pRawZone, boost::bind(&PhysicsService::onDestroyPhysicsZone, this, _1)); 
    5557    m_zoneSet.insert(pZone); 
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZNewton/src/PhysicsService.hpp

    r3053 r3342  
    5454    /// @{ 
    5555public: 
    56     virtual pPhysicsZone_type createZone(void); 
     56    virtual pPhysicsZone_type createZone(const Math::Vector3& _min, const Math::Vector3& _max); 
    5757        virtual void stepSimulation(double _elapsedTime); 
    5858    /// @} 
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZNewton/src/PhysicsZone.cpp

    r3339 r3342  
    4343namespace ZNewton { 
    4444//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    45 PhysicsZone::PhysicsZone() 
    46 :   m_pScriptModule(Engine::Physics::I_PhysicsManager::getSingleton().getDefaultScriptModule()) 
     45PhysicsZone::PhysicsZone(const Math::Vector3& _min, const Math::Vector3& _max) 
     46:   I_PhysicsZone(_min,_max) 
     47,   m_pScriptModule(Engine::Physics::I_PhysicsManager::getSingleton().getDefaultScriptModule()) 
    4748,   m_pScriptObject(NULL) 
    4849{ 
     
    5455    NewtonSetFrictionModel(m_pZone, 1); 
    5556    NewtonSetSolverModel(m_pZone, 2); 
     57 
     58        // set the size of the world 
     59    NewtonSetWorldSize(m_pZone, _min.m_array, _max.m_array);  
    5660} 
    5761 
     
    8185{ 
    8286    return NewtonMaterialGetDefaultGroupID(m_pZone); 
    83 } 
    84  
    85 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 
    86 void 
    87 PhysicsZone::setZoneSize(const Math::Vector3& _min, const Math::Vector3& _max) 
    88 { 
    89         // set the size of the world 
    90     NewtonSetWorldSize(m_pZone, _min.m_array, _max.m_array);  
    9187} 
    9288 
  • plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZNewton/src/PhysicsZone.hpp

    r3339 r3342  
    7676public: 
    7777    virtual int getDefaultMaterialID(); 
    78     virtual void setZoneSize(const Math::Vector3& _min, const Math::Vector3& _max); 
    7978    virtual void setGravity(const Math::Vector3& _grav); 
    8079    virtual pPhysicsActor_type createActor(); 
     
    153152    /// @{ 
    154153public: 
    155              PhysicsZone(); 
     154             PhysicsZone(const Math::Vector3& _min, const Math::Vector3& _max); 
    156155    virtual ~PhysicsZone(); 
    157156    /// @}