-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f907e82
commit 7caa1d7
Showing
11 changed files
with
208 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef JOINT2D_COMPONENT_H | ||
#define JOINT2D_COMPONENT_H | ||
|
||
#include "Supernova.h" | ||
|
||
class b2Joint; | ||
|
||
namespace Supernova{ | ||
|
||
enum class Joint2DType{ | ||
DISTANCE, | ||
REVOLUTE | ||
}; | ||
|
||
struct Joint2DComponent{ | ||
b2Joint* joint = NULL; | ||
|
||
Entity bodyA; | ||
Entity bodyB; | ||
Joint2DType type = Joint2DType::DISTANCE; | ||
bool collideConnected = false; | ||
|
||
Vector2 localAnchorA = Vector2(0.0f, 0.0f); | ||
Vector2 localAnchorB = Vector2(0.0f, 0.0f); | ||
float referenceAngle = 0.0f; | ||
float lowerAngle = 0.0f; | ||
float upperAngle = 0.0f; | ||
float maxMotorTorque = 0.0f; | ||
float motorSpeed = 0.0f; | ||
float enableLimit = false; | ||
float enableMotor = false; | ||
|
||
bool needUpdate = true; | ||
}; | ||
|
||
} | ||
|
||
#endif //JOINT2D_COMPONENT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// (c) 2023 Eduardo Doria. | ||
// | ||
|
||
#include "Joint2D.h" | ||
|
||
#include "subsystem/PhysicsSystem.h" | ||
#include "component/Body2DComponent.h" | ||
|
||
using namespace Supernova; | ||
|
||
Joint2D::Joint2D(Scene* scene, Entity entity): EntityHandle(scene, entity){ | ||
|
||
} | ||
|
||
Joint2D::~Joint2D(){ | ||
|
||
} | ||
|
||
Joint2D::Joint2D(const Joint2D& rhs): EntityHandle(rhs){ | ||
|
||
} | ||
|
||
Joint2D& Joint2D::operator=(const Joint2D& rhs){ | ||
|
||
return *this; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// (c) 2023 Eduardo Doria. | ||
// | ||
|
||
#ifndef JOINT2D_H | ||
#define JOINT2D_H | ||
|
||
#include "EntityHandle.h" | ||
|
||
namespace Supernova{ | ||
|
||
class Joint2D: public EntityHandle{ | ||
public: | ||
Joint2D(Scene* scene, Entity entity); | ||
virtual ~Joint2D(); | ||
|
||
Joint2D(const Joint2D& rhs); | ||
Joint2D& operator=(const Joint2D& rhs); | ||
|
||
}; | ||
} | ||
|
||
#endif //BODY2D_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters