Skip to content

Commit

Permalink
[allocator] Fix windows code
Browse files Browse the repository at this point in the history
[body] Fix isSleeping
  • Loading branch information
Nicolas BOUQUET committed Dec 30, 2024
1 parent 4e1ef47 commit e1568a5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions include/reactphysics3d/body/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class Body {
/// Set whether or not the body is active
virtual void setIsActive(bool isActive);

virtual void setIsSleeping(bool isSleeping) {};

/// Return the current position and orientation
const Transform& getTransform() const;

Expand Down
2 changes: 1 addition & 1 deletion include/reactphysics3d/body/RigidBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class RigidBody : public Body {
void enableGravity(bool isEnabled);

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

/// Return the linear velocity damping factor
decimal getLinearDamping() const;
Expand Down
1 change: 1 addition & 0 deletions include/reactphysics3d/containers/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <cstring>
#include <iterator>
#include <memory>
#include <vector>

namespace reactphysics3d {

Expand Down
2 changes: 1 addition & 1 deletion include/reactphysics3d/memory/DefaultAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DefaultAllocator : public MemoryAllocator {
virtual void release(void* pointer, size_t /*size*/) override {

// If compiler is Visual Studio
#ifdef RP3D_COMPILER_VISUAL_STUDIO
#ifdef RP3D_PLATFORM_WINDOWS

// Visual Studio doesn't not support standard std:aligned_alloc() method from c++ 17
return _aligned_free(pointer);
Expand Down
5 changes: 1 addition & 4 deletions src/collision/Collider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ void Collider::setLocalToBodyTransform(const Transform& transform) {
const Transform& bodyTransform = mBody->mWorld.mTransformComponents.getTransform(mBody->getEntity());
mBody->mWorld.mCollidersComponents.setLocalToWorldTransform(mEntity, bodyTransform * transform);

RigidBody* rigidBody = dynamic_cast<RigidBody*>(mBody);
if (rigidBody != nullptr) {
rigidBody->setIsSleeping(false);
}
mBody->setIsSleeping(false);

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

Expand Down

0 comments on commit e1568a5

Please sign in to comment.