diff options
Diffstat (limited to 'source/modules/asura-box2d')
32 files changed, 321 insertions, 46 deletions
diff --git a/source/modules/asura-box2d/box2d_module.cpp b/source/modules/asura-box2d/Box2DModule.cpp index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/box2d_module.cpp +++ b/source/modules/asura-box2d/Box2DModule.cpp diff --git a/source/modules/asura-box2d/box2d_module.h b/source/modules/asura-box2d/Box2DModule.h index 052078a..1a00608 100644 --- a/source/modules/asura-box2d/box2d_module.h +++ b/source/modules/asura-box2d/Box2DModule.h @@ -1,7 +1,7 @@ #ifndef __ASURA_BOX2D_MODULE_H__ #define __ASURA_BOX2D_MODULE_H__ -#include <asura-utils/module.h> +#include <asura-utils/Module.h> namespace AsuraEngine { diff --git a/source/modules/asura-box2d/Physics/Body.h b/source/modules/asura-box2d/Physics/Body.h new file mode 100644 index 0000000..e5af76a --- /dev/null +++ b/source/modules/asura-box2d/Physics/Body.h @@ -0,0 +1,67 @@ +#ifndef __ASURA_BOX2D_BODY_H__ +#define __ASURA_BOX2D_BODY_H__ + +#include <Box2D/Box2D.h> + +#include <asura-utils/Scripting/Portable.hpp> + +namespace AsuraEngine +{ + namespace Physics + { + + class World; + class Joint; + + enum BodyType + { + BODY_TYPE_INVALID, + BODY_TYPE_STATIC, + BODY_TYPE_DYNAMIC, + BODY_TYPE_KINEMATIC + }; + + class Body + : public AEScripting::Portable<Body> + { + public: + + private: + + friend class Joint; + + //----------------------------------------------------------------------------// + + LUAX_DECL_FACTORY(Body); + + LUAX_DECL_ENUM(BodyType, 1); + + LUAX_DECL_METHOD(_GetType); + LUAX_DECL_METHOD(_GetX); + LUAX_DECL_METHOD(_GetY); + LUAX_DECL_METHOD(_GetAngle); + LUAX_DECL_METHOD(_GetPosition); + LUAX_DECL_METHOD(_GetLinearVelocity); + LUAX_DECL_METHOD(_GetWorldCenter); + LUAX_DECL_METHOD(_GetLocalCenter); + LUAX_DECL_METHOD(_GetAngularVelocity); + LUAX_DECL_METHOD(_GetMass); + LUAX_DECL_METHOD(_GetInertia); + LUAX_DECL_METHOD(_GetMassData); + LUAX_DECL_METHOD(_GetAngularDamping); + LUAX_DECL_METHOD(_GetLinearDamping); + LUAX_DECL_METHOD(_GetGravityScale); + LUAX_DECL_METHOD(_GetGravityScale); + + //----------------------------------------------------------------------------// + + b2Body *body; + + World* mWorld; + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/source/modules/asura-box2d/Physics/ChainShape.h b/source/modules/asura-box2d/Physics/ChainShape.h new file mode 100644 index 0000000..2ce19fb --- /dev/null +++ b/source/modules/asura-box2d/Physics/ChainShape.h @@ -0,0 +1,29 @@ +#ifndef __ASURA_CHAIN_SHAPE_H__ +#define __ASURA_CHAIN_SHAPE_H__ + +#include <Box2D/Collision/Shapes/b2ChainShape.h> + +#include <asura-utils/Scripting/Portable.hpp> +#include <asura-utils/Classes.h> + +namespace_begin(AsuraEngine) +namespace_begin(Physics) + +class ChainShape + : AEScripting::Portable<ChainShape> +{ +public: + + ChainShape(); + ~ChainShape(); + +private: + + b2ChainShape* mShape; + +}; + +namespace_end +namespace_end + +#endif
\ No newline at end of file diff --git a/source/modules/asura-box2d/physics/circle_shape.h b/source/modules/asura-box2d/Physics/CircleShape.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/circle_shape.h +++ b/source/modules/asura-box2d/Physics/CircleShape.h diff --git a/source/modules/asura-box2d/physics/distance_joint.h b/source/modules/asura-box2d/Physics/Contact.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/distance_joint.h +++ b/source/modules/asura-box2d/Physics/Contact.h diff --git a/source/modules/asura-box2d/Physics/DebugDraw.h b/source/modules/asura-box2d/Physics/DebugDraw.h new file mode 100644 index 0000000..a92be43 --- /dev/null +++ b/source/modules/asura-box2d/Physics/DebugDraw.h @@ -0,0 +1,9 @@ +#ifndef _ASURA_BOX2D_DEBUG_DRAW_H_ +#define _ASURA_BOX2D_DEBUG_DRAW_H_ + +namespace AsuraEngine +{ + +} + +#endif
\ No newline at end of file diff --git a/source/modules/asura-box2d/physics/edge_shape.h b/source/modules/asura-box2d/Physics/DistanceJoint.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/edge_shape.h +++ b/source/modules/asura-box2d/Physics/DistanceJoint.h diff --git a/source/modules/asura-box2d/physics/friction_joint.h b/source/modules/asura-box2d/Physics/EdgeShape.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/friction_joint.h +++ b/source/modules/asura-box2d/Physics/EdgeShape.h diff --git a/source/modules/asura-box2d/physics/gear_joint.h b/source/modules/asura-box2d/Physics/Fixture.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/gear_joint.h +++ b/source/modules/asura-box2d/Physics/Fixture.h diff --git a/source/modules/asura-box2d/physics/motor_joint.h b/source/modules/asura-box2d/Physics/FrictionJoint.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/motor_joint.h +++ b/source/modules/asura-box2d/Physics/FrictionJoint.h diff --git a/source/modules/asura-box2d/physics/mouse_joint.h b/source/modules/asura-box2d/Physics/GearJoint.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/mouse_joint.h +++ b/source/modules/asura-box2d/Physics/GearJoint.h diff --git a/source/modules/asura-box2d/physics/polygon_shape.h b/source/modules/asura-box2d/Physics/Joint.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/polygon_shape.h +++ b/source/modules/asura-box2d/Physics/Joint.h diff --git a/source/modules/asura-box2d/physics/prismatic_joint.h b/source/modules/asura-box2d/Physics/MotorJoint.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/prismatic_joint.h +++ b/source/modules/asura-box2d/Physics/MotorJoint.h diff --git a/source/modules/asura-box2d/physics/pulley_joint.h b/source/modules/asura-box2d/Physics/MouseJoint.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/pulley_joint.h +++ b/source/modules/asura-box2d/Physics/MouseJoint.h diff --git a/source/modules/asura-box2d/physics/revolute_joint.h b/source/modules/asura-box2d/Physics/PolygonShape.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/revolute_joint.h +++ b/source/modules/asura-box2d/Physics/PolygonShape.h diff --git a/source/modules/asura-box2d/physics/rope_joint.h b/source/modules/asura-box2d/Physics/PrismaticJoint.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/rope_joint.h +++ b/source/modules/asura-box2d/Physics/PrismaticJoint.h diff --git a/source/modules/asura-box2d/physics/weld_joint.h b/source/modules/asura-box2d/Physics/PulleyJoint.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/weld_joint.h +++ b/source/modules/asura-box2d/Physics/PulleyJoint.h diff --git a/source/modules/asura-box2d/physics/wheel_joint.h b/source/modules/asura-box2d/Physics/RevoluteJoint.h index e69de29..e69de29 100644 --- a/source/modules/asura-box2d/physics/wheel_joint.h +++ b/source/modules/asura-box2d/Physics/RevoluteJoint.h diff --git a/source/modules/asura-box2d/Physics/RopeJoint.h b/source/modules/asura-box2d/Physics/RopeJoint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/Physics/RopeJoint.h diff --git a/source/modules/asura-box2d/Physics/Shape.h b/source/modules/asura-box2d/Physics/Shape.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/Physics/Shape.h diff --git a/source/modules/asura-box2d/Physics/WeldJoint.h b/source/modules/asura-box2d/Physics/WeldJoint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/Physics/WeldJoint.h diff --git a/source/modules/asura-box2d/Physics/WheelJoint.h b/source/modules/asura-box2d/Physics/WheelJoint.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/modules/asura-box2d/Physics/WheelJoint.h diff --git a/source/modules/asura-box2d/Physics/World.h b/source/modules/asura-box2d/Physics/World.h new file mode 100644 index 0000000..b6d00ca --- /dev/null +++ b/source/modules/asura-box2d/Physics/World.h @@ -0,0 +1,19 @@ +#ifndef __ASURA_BOX2D_WORLD_H__ +#define __ASURA_BOX2D_WORLD_H__ + +#include <asura-utils/Scripting/Portable.hpp> + +namespace AsuraEngine +{ + namespace Physics + { + + class World : public AEScripting::Portable<World> + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/source/modules/asura-box2d/Physics/binding/_body.cpp b/source/modules/asura-box2d/Physics/binding/_body.cpp new file mode 100644 index 0000000..0c9e3e8 --- /dev/null +++ b/source/modules/asura-box2d/Physics/binding/_body.cpp @@ -0,0 +1,171 @@ +#include "../Body.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Physics + { + + LUAX_REGISTRY(Body) + { + LUAX_REGISTER_METHODS(state, + { "GetType", _GetType }, + { "GetX", _GetX }, + { "GetY", _GetY }, + { "GetAngle", _GetAngle }, + { "GetPosition", _GetPosition }, + { "GetLinearVelocity", _GetLinearVelocity }, + { "GetWorldCenter", _GetWorldCenter }, + { "GetLocalCenter", _GetLocalCenter }, + { "GetAngularVelocity", _GetAngularVelocity }, + { "GetMass", _GetMass }, + { "GetInertia", _GetInertia }, + { "GetMassData", _GetMassData }, + { "GetAngularDamping", _GetAngularDamping }, + { "GetLinearDamping", _GetLinearDamping }, + { "GetGravityScale", _GetGravityScale }, + { "GetGravityScale", _GetGravityScale } + ); + } + + LUAX_POSTPROCESS(Body) + { + LUAX_REGISTER_ENUM(state, "EBodyType", + { "INVALID", BODY_TYPE_INVALID }, + { "STATIC", BODY_TYPE_STATIC }, + { "DYNAMIC", BODY_TYPE_DYNAMIC }, + { "KINEMATIC", BODY_TYPE_KINEMATIC } + ); + + } + + // body:GetType() + LUAX_IMPL_METHOD(Body, _GetType) + { + LUAX_PREPARE(L, Body); + return 0; + } + + // body:GetX() + LUAX_IMPL_METHOD(Body, _GetX) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetY() + LUAX_IMPL_METHOD(Body, _GetY) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngle() + LUAX_IMPL_METHOD(Body, _GetAngle) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetPosition() + LUAX_IMPL_METHOD(Body, _GetPosition) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLinearVelocity() + LUAX_IMPL_METHOD(Body, _GetLinearVelocity) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetWorldCenter() + LUAX_IMPL_METHOD(Body, _GetWorldCenter) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLocalCenter() + LUAX_IMPL_METHOD(Body, _GetLocalCenter) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngularVelocity() + LUAX_IMPL_METHOD(Body, _GetAngularVelocity) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetMass() + LUAX_IMPL_METHOD(Body, _GetMass) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetInertia() + LUAX_IMPL_METHOD(Body, _GetInertia) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetMassData() + LUAX_IMPL_METHOD(Body, _GetMassData) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngularDamping() + LUAX_IMPL_METHOD(Body, _GetAngularDamping) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLinearDamping() + LUAX_IMPL_METHOD(Body, _GetLinearDamping) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetGravityScale() + LUAX_IMPL_METHOD(Body, _GetGravityScale) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetGravityScale() + LUAX_IMPL_METHOD(Body, _GetGravityScale) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + } +} diff --git a/source/modules/asura-box2d/Physics/binding/_world.cpp b/source/modules/asura-box2d/Physics/binding/_world.cpp new file mode 100644 index 0000000..0940959 --- /dev/null +++ b/source/modules/asura-box2d/Physics/binding/_world.cpp @@ -0,0 +1,21 @@ +#include "../World.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Physics + { + /* + LUAX_REGISTRY(World) + { + + } + + LUAX_POSTPROCESS(World) + { + + } +*/ + } +} diff --git a/source/modules/asura-box2d/physics/binding/_body.cpp b/source/modules/asura-box2d/physics/binding/_body.cpp index 0dbd292..0c9e3e8 100644 --- a/source/modules/asura-box2d/physics/binding/_body.cpp +++ b/source/modules/asura-box2d/physics/binding/_body.cpp @@ -1,4 +1,4 @@ -#include "../body.h" +#include "../Body.h" using namespace std; diff --git a/source/modules/asura-box2d/physics/binding/_world.cpp b/source/modules/asura-box2d/physics/binding/_world.cpp index 1ebcbd1..0940959 100644 --- a/source/modules/asura-box2d/physics/binding/_world.cpp +++ b/source/modules/asura-box2d/physics/binding/_world.cpp @@ -1,4 +1,4 @@ -#include "../world.h" +#include "../World.h" using namespace std; diff --git a/source/modules/asura-box2d/physics/body.h b/source/modules/asura-box2d/physics/body.h index 3a4aa5f..e5af76a 100644 --- a/source/modules/asura-box2d/physics/body.h +++ b/source/modules/asura-box2d/physics/body.h @@ -3,7 +3,7 @@ #include <Box2D/Box2D.h> -#include <asura-utils/scripting/portable.hpp> +#include <asura-utils/Scripting/Portable.hpp> namespace AsuraEngine { diff --git a/source/modules/asura-box2d/physics/chain_shape.h b/source/modules/asura-box2d/physics/chain_shape.h deleted file mode 100644 index dd03ddf..0000000 --- a/source/modules/asura-box2d/physics/chain_shape.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef __ASURA_CHAIN_SHAPE_H__ -#define __ASURA_CHAIN_SHAPE_H__ - -// 3rd-party -#include <Box2D/Collision/Shapes/b2ChainShape.h> - -// asura modules -#include <asura-utils/scripting/portable.hpp> - -namespace AsuraEngine -{ - namespace Physics - { - - class ChainShape - : AEScripting::Portable<ChainShape> - { - public: - - ChainShape(); - ~ChainShape(); - - private: - - b2ChainShape* mShape; - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/source/modules/asura-box2d/physics/debug_draw.h b/source/modules/asura-box2d/physics/debug_draw.h deleted file mode 100644 index cff682b..0000000 --- a/source/modules/asura-box2d/physics/debug_draw.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __ASURA_BOX2D_DEBUG_DRAW_H__ -#define __ASURA_BOX2D_DEBUG_DRAW_H__ - -namespace AsuraEngine -{ - -} - -#endif
\ No newline at end of file diff --git a/source/modules/asura-box2d/physics/world.h b/source/modules/asura-box2d/physics/world.h index 0aac0c8..b6d00ca 100644 --- a/source/modules/asura-box2d/physics/world.h +++ b/source/modules/asura-box2d/physics/world.h @@ -1,7 +1,7 @@ #ifndef __ASURA_BOX2D_WORLD_H__ #define __ASURA_BOX2D_WORLD_H__ -#include <asura-utils/scripting/portable.hpp> +#include <asura-utils/Scripting/Portable.hpp> namespace AsuraEngine { |