Skip to content

Commit e1568a5

Browse files
author
Nicolas BOUQUET
committed
[allocator] Fix windows code
[body] Fix isSleeping
1 parent 4e1ef47 commit e1568a5

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

include/reactphysics3d/body/Body.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ class Body {
117117
/// Set whether or not the body is active
118118
virtual void setIsActive(bool isActive);
119119

120+
virtual void setIsSleeping(bool isSleeping) {};
121+
120122
/// Return the current position and orientation
121123
const Transform& getTransform() const;
122124

include/reactphysics3d/body/RigidBody.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class RigidBody : public Body {
145145
void enableGravity(bool isEnabled);
146146

147147
/// Set the variable to know whether or not the body is sleeping
148-
void setIsSleeping(bool isSleeping);
148+
void setIsSleeping(bool isSleeping) override;
149149

150150
/// Return the linear velocity damping factor
151151
decimal getLinearDamping() const;

include/reactphysics3d/containers/Array.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <cstring>
3434
#include <iterator>
3535
#include <memory>
36+
#include <vector>
3637

3738
namespace reactphysics3d {
3839

include/reactphysics3d/memory/DefaultAllocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class DefaultAllocator : public MemoryAllocator {
7777
virtual void release(void* pointer, size_t /*size*/) override {
7878

7979
// If compiler is Visual Studio
80-
#ifdef RP3D_COMPILER_VISUAL_STUDIO
80+
#ifdef RP3D_PLATFORM_WINDOWS
8181

8282
// Visual Studio doesn't not support standard std:aligned_alloc() method from c++ 17
8383
return _aligned_free(pointer);

src/collision/Collider.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ void Collider::setLocalToBodyTransform(const Transform& transform) {
111111
const Transform& bodyTransform = mBody->mWorld.mTransformComponents.getTransform(mBody->getEntity());
112112
mBody->mWorld.mCollidersComponents.setLocalToWorldTransform(mEntity, bodyTransform * transform);
113113

114-
RigidBody* rigidBody = dynamic_cast<RigidBody*>(mBody);
115-
if (rigidBody != nullptr) {
116-
rigidBody->setIsSleeping(false);
117-
}
114+
mBody->setIsSleeping(false);
118115

119116
mBody->mWorld.mCollisionDetection.updateCollider(mEntity);
120117

0 commit comments

Comments
 (0)