mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Moved most constants into relevant classes.
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2009 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
|
||||
#ifndef LOVE_PHYSICS_JOINT_H
|
||||
#define LOVE_PHYSICS_JOINT_H
|
||||
|
||||
// LOVE
|
||||
#include <common/Object.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace physics
|
||||
{
|
||||
class Joint : public Object
|
||||
{
|
||||
public:
|
||||
|
||||
enum JointType
|
||||
{
|
||||
JOINT_DISTANCE,
|
||||
JOINT_REVOLUTE,
|
||||
JOINT_PRISMATIC,
|
||||
JOINT_MOUSE,
|
||||
JOINT_PULLEY,
|
||||
JOINT_GEAR
|
||||
};
|
||||
|
||||
|
||||
virtual ~Joint(){}
|
||||
};
|
||||
|
||||
} // physics
|
||||
} // love
|
||||
|
||||
#endif // LOVE_PHYSICS_JOINT_H
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2009 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
|
||||
#ifndef LOVE_PHYSICS_SHAPE_H
|
||||
#define LOVE_PHYSICS_SHAPE_H
|
||||
|
||||
// LOVE
|
||||
#include <common/Object.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace physics
|
||||
{
|
||||
class Shape : public Object
|
||||
{
|
||||
public:
|
||||
|
||||
enum ShapeType
|
||||
{
|
||||
SHAPE_CIRCLE,
|
||||
SHAPE_POLYGON,
|
||||
};
|
||||
|
||||
virtual ~Shape(){}
|
||||
};
|
||||
|
||||
} // physics
|
||||
} // love
|
||||
|
||||
#endif // LOVE_PHYSICS_SHAPE_H
|
||||
@@ -61,17 +61,17 @@ namespace box2d
|
||||
switch(joint->GetType())
|
||||
{
|
||||
case e_revoluteJoint:
|
||||
return love::JOINT_REVOLUTE;
|
||||
return JOINT_REVOLUTE;
|
||||
case e_prismaticJoint:
|
||||
return love::JOINT_PRISMATIC;
|
||||
return JOINT_PRISMATIC;
|
||||
case e_distanceJoint:
|
||||
return love::JOINT_DISTANCE;
|
||||
return JOINT_DISTANCE;
|
||||
case e_pulleyJoint:
|
||||
return love::JOINT_PULLEY;
|
||||
return JOINT_PULLEY;
|
||||
case e_mouseJoint:
|
||||
return love::JOINT_MOUSE;
|
||||
return JOINT_MOUSE;
|
||||
case e_gearJoint:
|
||||
return love::JOINT_GEAR;
|
||||
return JOINT_GEAR;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
|
||||
// LOVE
|
||||
#include <common/runtime.h>
|
||||
#include <common/Object.h>
|
||||
#include <common/constants.h>
|
||||
#include <physics/Joint.h>
|
||||
|
||||
// Box2D
|
||||
#include "Include/Box2D.h"
|
||||
@@ -44,7 +43,7 @@ namespace box2d
|
||||
* A Joint can be used to prevent Bodies from going to
|
||||
* far apart, or coming too close together.
|
||||
**/
|
||||
class Joint : public Object
|
||||
class Joint : public love::physics::Joint
|
||||
{
|
||||
friend class GearJoint;
|
||||
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
#define LOVE_PHYSICS_BOX2D_SHAPE_H
|
||||
|
||||
// LOVE
|
||||
#include <common/Object.h>
|
||||
#include <physics/Shape.h>
|
||||
#include <common/Reference.h>
|
||||
#include <common/constants.h>
|
||||
|
||||
// Box2D
|
||||
#include "Include/Box2D.h"
|
||||
@@ -56,7 +55,7 @@ namespace box2d
|
||||
* a Shape's geometry will be affected by the parent
|
||||
* body's transformation.
|
||||
**/
|
||||
class Shape : public Object
|
||||
class Shape : public love::physics::Shape
|
||||
{
|
||||
protected:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user