Changeset 2910


Ignore:
Timestamp:
Sep 13, 2013, 1:47:06 PM (6 years ago)
Author:
sam
Message:

physics: always activate Bullet and remove dead code.

Location:
trunk
Files:
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/build/vs2010/Lol.Core.Vars.props

    r2569 r2910  
    2020    <Win32Defines>HAVE_SDL_H;USE_SDL;$(Win32Defines)</Win32Defines>
    2121    <Win32Defines>USE_SDL_MIXER;USE_SDL_IMAGE;$(Win32Defines)</Win32Defines>
    22 
    23     <!-- BulletPhysics -->
    24     <BtPhysDir>$(ExternalDir)\bullet-2.80-rev2531</BtPhysDir>
    25     <BtPhysIncludes>$(BtPhysDir)\include;$(BtPhysDir)\include\bullet</BtPhysIncludes>
    26     <Win32Defines Condition="'$(UseBullet)'=='true'">HAVE_PHYS_USE_BULLET;$(Win32Defines)</Win32Defines>
    27     <Ps3Defines Condition="'$(UseBullet)'=='true'">HAVE_PHYS_USE_BULLET;$(Ps3Defines)</Ps3Defines>
    28     <XboxDefines Condition="'$(UseBullet)'=='true'">HAVE_PHYS_USE_BULLET;$(XboxDefines)</XboxDefines>
    2922
    3023    <!-- GTK+ & GtkGl -->
  • trunk/build/vs2010/config-build.xml

    r1610 r2910  
    1010    <UseOpenGL>true</UseOpenGL>
    1111
    12     <!-- Use Bullet for our physics solver? -->
    13     <UseBullet>true</UseBullet>
    14 
    1512  </PropertyGroup>
    1613</Project>
  • trunk/build/vs2012/Lol.Core.Vars.props

    r2853 r2910  
    2020    <Win32Defines>HAVE_SDL_H;USE_SDL;$(Win32Defines)</Win32Defines>
    2121    <Win32Defines>USE_SDL_MIXER;USE_SDL_IMAGE;$(Win32Defines)</Win32Defines>
    22 
    23     <!-- BulletPhysics -->
    24     <BtPhysDir>$(ExternalDir)\bullet-2.80-rev2531</BtPhysDir>
    25     <BtPhysIncludes>$(BtPhysDir)\include;$(BtPhysDir)\include\bullet</BtPhysIncludes>
    26     <Win32Defines Condition="'$(UseBullet)'=='true'">HAVE_PHYS_USE_BULLET;$(Win32Defines)</Win32Defines>
    27     <Ps3Defines Condition="'$(UseBullet)'=='true'">HAVE_PHYS_USE_BULLET;$(Ps3Defines)</Ps3Defines>
    28     <XboxDefines Condition="'$(UseBullet)'=='true'">HAVE_PHYS_USE_BULLET;$(XboxDefines)</XboxDefines>
    2922
    3023    <!-- GTK+ & GtkGl -->
  • trunk/test/btphystest.cpp

    r2909 r2910  
    1414
    1515using namespace lol;
    16 
    17 #ifndef HAVE_PHYS_USE_BULLET
    18 #define HAVE_PHYS_USE_BULLET
    19 #endif /* HAVE_PHYS_USE_BULLET */
    2016
    2117#include "physics/lolphysics.h"
  • trunk/test/nacl_phystest.cpp

    r2907 r2910  
    1414
    1515using namespace lol;
    16 
    17 #ifndef HAVE_PHYS_USE_BULLET
    18 #define HAVE_PHYS_USE_BULLET
    19 #endif /* HAVE_PHYS_USE_BULLET */
    2016
    2117//#include "physics/lolphysics.h"
  • trunk/test/physics/bulletcharactercontroller.cpp

    r2816 r2910  
    1717#define USE_LOL_CTRLR_CHARAC
    1818
    19 #ifdef HAVE_PHYS_USE_BULLET
    2019#include "core.h"
    2120#include <stdio.h>
     
    3130//#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
    3231//#include "LinearMath/btDefaultMotionState.h"
    33 #endif //HAVE_PHYS_USE_BULLET
    34 
    3532
    3633namespace lol
     
    4138
    4239#ifdef USE_LOL_CTRLR_CHARAC
    43 #ifdef HAVE_PHYS_USE_BULLET
    4440
    4541//When called, will try to remove Character controller from its collision.
     
    239235}
    240236
    241 #endif // HAVE_PHYS_USE_BULLET
    242237#endif // USE_LOL_CTRLR_CHARAC
    243238
  • trunk/test/physics/bulletcharactercontroller.h

    r2816 r2910  
    1919#define __BULLETCHARACTERCONTROLLER_BULLETCHARACTERCONTROLLER_H__
    2020
    21 #ifdef HAVE_PHYS_USE_BULLET
    2221#include "core.h"
    2322#include "easyphysics.h"
    2423//#include "BulletDynamics\Character\btCharacterControllerInterface.h"
    25 #endif
    2624
    2725#define USE_LOL_CTRLR_CHARAC
     
    3432
    3533#ifdef USE_LOL_CTRLR_CHARAC
    36 #ifdef HAVE_PHYS_USE_BULLET
    3734
    3835    //SweepCallback used for Swweep Tests.
     
    279276        };
    280277
    281 #endif // HAVE_PHYS_USE_BULLET
    282278#endif // USE_LOL_CTRLR_CHARAC
    283279
  • trunk/test/physics/easycharactercontroller.cpp

    r2816 r2910  
    2424namespace phys
    2525{
    26 
    27 #ifdef HAVE_PHYS_USE_BULLET
    2826
    2927//-------------------------------------------------------------------------
     
    147145}
    148146
    149 #endif // HAVE_PHYS_USE_BULLET
    150 
    151147} /* namespace phys */
    152148
  • trunk/test/physics/easycharactercontroller.h

    r2816 r2910  
    2121#define __EASYCHARACTERCONTROLLER_EASYCHARACTERCONTROLLER_H__
    2222
    23 #ifdef HAVE_PHYS_USE_BULLET
    2423#include "core.h"
    2524#include "easyphysics.h"
    2625#include "bulletcharactercontroller.h"
    2726#include <BulletDynamics/Character/btKinematicCharacterController.h>
    28 #endif
    2927
    3028namespace lol
     
    4038    friend class Simulation;
    4139    friend class EasyPhysic;
    42 
    43 #ifdef HAVE_PHYS_USE_BULLET
    4440
    4541public:
     
    10298    vec3                            m_walk_velocity;
    10399    vec3                            m_current_velocity;
    104 
    105 #else  // NO PHYSIC IMPLEMENTATION
    106 
    107     virtual void InitBodyToRigid(bool ZeroMassIsKinematic=false) { }
    108     virtual void InitBodyToGhost() { }
    109     virtual void AddToSimulation(class Simulation* current_simulation) { }
    110     virtual void RemoveFromSimulation(class Simulation* current_simulation) { }
    111     virtual void SetMovementForFrame(vec3 const &MoveQuantity) { }
    112 
    113 #endif // PHYSIC IMPLEMENTATION
    114 
    115100};
    116101
  • trunk/test/physics/easyconstraint.cpp

    r2816 r2910  
    1313namespace phys
    1414{
    15 
    16 #ifdef HAVE_PHYS_USE_BULLET
    1715
    1816//-------------------------------------------------------------------------
     
    4038}
    4139
    42 #endif // HAVE_PHYS_USE_BULLET
    43 
    4440} /* namespace phys */
    4541
    4642} /* namespace lol */
     43
  • trunk/test/physics/easyconstraint.h

    r2816 r2910  
    1818#define __EASYCONSTRAINT_EASYCONSTRAINT_H__
    1919
    20 #ifdef HAVE_PHYS_USE_BULLET
    2120#include "core.h"
    2221#include "easyphysics.h"
    23 #endif
    2422
    2523namespace lol
     
    3432    friend class Simulation;
    3533    friend class EasyPhysic;
    36 
    37 #ifdef HAVE_PHYS_USE_BULLET
    3834
    3935public:
     
    134130    btGeneric6DofConstraint*    m_6dof_constraint;
    135131
    136 #else  // NO PHYSIC IMPLEMENTATION
    137 
    138 public:
    139     EasyConstraint() :
    140         m_a_physobj(NULL),
    141         m_b_physobj(NULL),
    142         m_a_transform(lol::mat4(1.f)),
    143         m_b_transform(lol::mat4(1.f)),
    144         m_using_ref_a(false),
    145         m_disable_a2b_collision(false)
    146     {
    147     }
    148 
    149 private:
    150 
    151     void AddToSimulation(class Simulation* current_simulation) { }
    152     void RemoveFromSimulation(class Simulation* current_simulation) { }
    153 
    154     //check if Init can be done
    155     bool CanProceedWithInit() { return false; }
    156     void CustomInitConstraintToPoint2Point() { }
    157     void CustomInitConstraintToHinge() { }
    158     void CustomInitConstraintToSlider() { }
    159     void CustomInitConstraintToConeTwist() { }
    160     void CustomInitConstraintTo6Dof() { }
    161 
    162 #endif // PHYSIC IMPLEMENTATION
    163 
    164132public:
    165133    void InitConstraintToPoint2Point()    { if (CanProceedWithInit()) CustomInitConstraintToPoint2Point(); }
  • trunk/test/physics/easyphysics.cpp

    r2879 r2910  
    2323namespace phys
    2424{
    25 
    26 #ifdef HAVE_PHYS_USE_BULLET
    2725
    2826//-------------------------------------------------------------------------
     
    426424}
    427425
    428 #endif // HAVE_PHYS_USE_BULLET
    429 
    430426} /* namespace phys */
    431427
  • trunk/test/physics/easyphysics.h

    r2890 r2910  
    1818#define __EASYPHYSICS_EASYPHYSICS_H__
    1919
    20 #ifdef HAVE_PHYS_USE_BULLET
    2120#include "core.h"
    2221#include <bullet/btBulletDynamicsCommon.h>
    2322#include <bullet/btBulletCollisionCommon.h>
    2423#include <bullet/BulletCollision/CollisionDispatch/btGhostObject.h>
    25 #endif //HAVE_PHYS_USE_BULLET
    2624
    2725namespace lol
     
    3634    friend class Simulation;
    3735    friend class EasyConstraint;
    38 
    39 #ifdef HAVE_PHYS_USE_BULLET
    4036
    4137public:
     
    9389    btConvexShape*                              m_convex_shape;
    9490    btMotionState*                              m_motion_state;
    95 
    96 #else  // NO PHYSIC IMPLEMENTATION
    97 
    98 public:
    99     EasyPhysic(WorldEntity* NewOwnerEntity) { m_owner_entity = NewOwnerEntity; }
    100 
    101     virtual void SetShapeToBox(lol::vec3& BoxSize) { }
    102     virtual void SetShapeToSphere(float radius) { }
    103     virtual void SetShapeToCone(float radius, float height) { }
    104     virtual void SetShapeToCylinder(lol::vec3& cyl_size) { }
    105     virtual void SetShapeToCapsule(float radius, float height) { }
    106 
    107     virtual bool CanChangeCollisionChannel() { return true; }
    108     virtual mat4 GetTransform() { return mat4(1.0f); }
    109     virtual void SetTransform(const lol::vec3& base_location, const lol::quat& base_rotation=lol::quat(lol::mat4(1.0f))) { }
    110 private:
    111     virtual void BaseTransformChanged(const lol::mat4& PreviousMatrix, const lol::mat4& NewMatrix) { }
    112 public:
    113     virtual void SetMass(float mass) { }
    114     virtual float GetMass() { return .0f; }
    115     virtual void SetHitRestitution(float hit_restitution) { }
    116     virtual void InitBodyToRigid() { }
    117     virtual void InitBodyToGhost() { }
    118     virtual void AddToSimulation(class Simulation* current_simulation) { }
    119     virtual void RemoveFromSimulation(class Simulation* current_simulation) { }
    120 
    121     //Force/Impulse functions
    122     virtual void AddImpulse(const lol::vec3& impulse) { }
    123     virtual void AddImpulse(const lol::vec3& impulse, const lol::vec3& rel_pos) { }
    124       virtual void AddImpulseTorque(const lol::vec3& torque) { }
    125     virtual void AddForce(const lol::vec3& force) { }
    126     virtual void AddForce(const lol::vec3& force, const lol::vec3& rel_pos) { }
    127     virtual void AddForceTorque(const lol::vec3& torque) { }
    128 
    129     //Movements getter
    130     lol::vec3 GetLinearVelocity()    const { return lol::vec3(.0f); }
    131     lol::vec3 GetLinearForce()       const { return lol::vec3(.0f); }
    132     lol::vec3 GetAngularVelocity()   const { return lol::vec3(.0f); }
    133     lol::vec3 GetAngularForce()      const { return lol::vec3(.0f); }
    134 
    135     virtual void InitBodyToGhost() { }
    136 
    137 #endif // PHYSIC IMPLEMENTATION
    13891
    13992public:
  • trunk/test/physics/lolbtphysicsintegration.h

    r2816 r2910  
    2929#define GAMEGROUP_SIMULATION        GAMEGROUP_AFTER_1
    3030
    31 #ifdef HAVE_PHYS_USE_BULLET
    32 
    3331#define LOL2BT_UNIT                1.0f
    3432#define BT2LOL_UNIT                1.0f
     
    4745#define BT2LOL_QUAT(ELEMENT)    lol::quat((ELEMENT).getW(), BT2LOL_VEC3((ELEMENT).getAxis())
    4846
    49 #endif // HAVE_PHYS_USE_BULLET
    50 
    5147} /* namespace lol */
    5248
  • trunk/test/physics/lolphysics.h

    r2816 r2910  
    99#define __LOLPHYSICS_H__
    1010
    11 #ifdef HAVE_PHYS_USE_BULLET
    1211#include <cstring>
    1312#include <bullet/btBulletDynamicsCommon.h>
     
    1716#include "easyphysics.h"
    1817#include "easyconstraint.h"
    19 #endif
    2018
    2119namespace lol
     
    8179    char const *GetName() { return "<Simulation>"; }
    8280
    83 #ifdef HAVE_PHYS_USE_BULLET
    8481public:
    8582    void Init()
     
    268265    btDiscreteDynamicsWorld*                m_dynamics_world;
    269266
    270 #else  // NO PHYSIC IMPLEMENTATION
    271 
    272 public:
    273     void Init() { }
    274     void TickGame(float seconds) { }
    275     bool RayHits(RayCastResult& HitResult, eRaycastType RaycastType, const vec3& RayFrom, const vec3& RayTo, EasyPhysic* SourceCaster=NULL) { return false; }
    276     void Exit() { }
    277 private:
    278     void CustomSetContinuousDetection(bool ShouldUseCCD) { }
    279     void CustomSetGravity(vec3 &NewGravity) { }
    280     void CustomSetWorldLimit(vec3 &NewWorldMin, vec3 &NewWorldMax) { }
    281     void CustomSetTimestep(float NewTimestep) { }
    282 
    283 #endif // PHYSIC IMPLEMENTATION
    284 
    285267public:
    286268    //Main logic :
Note: See TracChangeset for help on using the changeset viewer.