diff --git a/cocos/base/CCEvent.h b/cocos/base/CCEvent.h index 4bc129c052..32c7537c1e 100644 --- a/cocos/base/CCEvent.h +++ b/cocos/base/CCEvent.h @@ -39,7 +39,7 @@ class Node; /** * Base class of all kinds of events. */ -class Event : public Ref +class CC_DLL Event : public Ref { public: enum class Type diff --git a/cocos/base/CCEventCustom.h b/cocos/base/CCEventCustom.h index fce6a315c3..00ea4555ed 100644 --- a/cocos/base/CCEventCustom.h +++ b/cocos/base/CCEventCustom.h @@ -29,7 +29,7 @@ NS_CC_BEGIN -class EventCustom : public Event +class CC_DLL EventCustom : public Event { public: /** Constructor */ diff --git a/cocos/base/CCEventListenerCustom.h b/cocos/base/CCEventListenerCustom.h index 10e9643790..c602d626b5 100644 --- a/cocos/base/CCEventListenerCustom.h +++ b/cocos/base/CCEventListenerCustom.h @@ -49,7 +49,7 @@ class EventCustom; * * dispatcher->removeEventListener(listener); */ -class EventListenerCustom : public EventListener +class CC_DLL EventListenerCustom : public EventListener { public: /** Creates an event listener with type and callback. diff --git a/cocos/physics/CCPhysicsBody.h b/cocos/physics/CCPhysicsBody.h index a9de180e0d..6ed512f1f2 100644 --- a/cocos/physics/CCPhysicsBody.h +++ b/cocos/physics/CCPhysicsBody.h @@ -53,7 +53,7 @@ const PhysicsMaterial PHYSICSBODY_MATERIAL_DEFAULT(0.1f, 0.5f, 0.5f); * if you create body with createEdgeXXX, the mass and moment will be PHYSICS_INFINITY by default. and it's a static body. * you can change mass and moment with setMass() and setMoment(). and you can change the body to be dynamic or static by use function setDynamic(). */ -class PhysicsBody : public Ref +class CC_DLL PhysicsBody : public Ref { public: /** create a body with defult mass and moment. */ diff --git a/cocos/physics/CCPhysicsContact.h b/cocos/physics/CCPhysicsContact.h index b67510cf9e..eee9727560 100644 --- a/cocos/physics/CCPhysicsContact.h +++ b/cocos/physics/CCPhysicsContact.h @@ -44,7 +44,7 @@ class PhysicsContactInfo; typedef Vec2 Vect; -typedef struct PhysicsContactData +typedef struct CC_DLL PhysicsContactData { static const int POINT_MAX = 4; Vec2 points[POINT_MAX]; @@ -59,7 +59,7 @@ typedef struct PhysicsContactData /** * @brief Contact infomation. it will created automatically when two shape contact with each other. and it will destoried automatically when two shape separated. */ -class PhysicsContact : public EventCustom +class CC_DLL PhysicsContact : public EventCustom { public: @@ -129,7 +129,7 @@ private: /* * @brief presolve value generated when onContactPreSolve called. */ -class PhysicsContactPreSolve +class CC_DLL PhysicsContactPreSolve { public: /** get restitution between two bodies*/ @@ -160,7 +160,7 @@ private: /* * @brief postsolve value generated when onContactPostSolve called. */ -class PhysicsContactPostSolve +class CC_DLL PhysicsContactPostSolve { public: /** get restitution between two bodies*/ @@ -181,7 +181,7 @@ private: }; /* contact listener. it will recive all the contact callbacks. */ -class EventListenerPhysicsContact : public EventListenerCustom +class CC_DLL EventListenerPhysicsContact : public EventListenerCustom { public: /** create the listener */ @@ -227,7 +227,7 @@ protected: }; /** this event listener only be called when bodyA and bodyB have contacts */ -class EventListenerPhysicsContactWithBodies : public EventListenerPhysicsContact +class CC_DLL EventListenerPhysicsContactWithBodies : public EventListenerPhysicsContact { public: static EventListenerPhysicsContactWithBodies* create(PhysicsBody* bodyA, PhysicsBody* bodyB); @@ -245,7 +245,7 @@ protected: }; /** this event listener only be called when shapeA and shapeB have contacts */ -class EventListenerPhysicsContactWithShapes : public EventListenerPhysicsContact +class CC_DLL EventListenerPhysicsContactWithShapes : public EventListenerPhysicsContact { public: static EventListenerPhysicsContactWithShapes* create(PhysicsShape* shapeA, PhysicsShape* shapeB); @@ -263,7 +263,7 @@ protected: }; /** this event listener only be called when shapeA or shapeB is in the group your specified */ -class EventListenerPhysicsContactWithGroup : public EventListenerPhysicsContact +class CC_DLL EventListenerPhysicsContactWithGroup : public EventListenerPhysicsContact { public: static EventListenerPhysicsContactWithGroup* create(int group); diff --git a/cocos/physics/CCPhysicsJoint.h b/cocos/physics/CCPhysicsJoint.h index e892b29032..9861bc9a63 100644 --- a/cocos/physics/CCPhysicsJoint.h +++ b/cocos/physics/CCPhysicsJoint.h @@ -42,7 +42,7 @@ class PhysicsBodyInfo; /* * @brief An PhysicsJoint object connects two physics bodies together. */ -class PhysicsJoint +class CC_DLL PhysicsJoint { protected: PhysicsJoint(); @@ -97,7 +97,7 @@ protected: /* * @brief A fixed joint fuses the two bodies together at a reference point. Fixed joints are useful for creating complex shapes that can be broken apart later. */ -class PhysicsJointFixed : public PhysicsJoint +class CC_DLL PhysicsJointFixed : public PhysicsJoint { public: static PhysicsJointFixed* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr); @@ -113,7 +113,7 @@ protected: /* * @brief A limit joint imposes a maximum distance between the two bodies, as if they were connected by a rope. */ -class PhysicsJointLimit : public PhysicsJoint +class CC_DLL PhysicsJointLimit : public PhysicsJoint { public: static PhysicsJointLimit* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2); @@ -139,7 +139,7 @@ protected: /* * @brief A pin joint allows the two bodies to independently rotate around the anchor point as if pinned together. */ -class PhysicsJointPin : public PhysicsJoint +class CC_DLL PhysicsJointPin : public PhysicsJoint { public: static PhysicsJointPin* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr); @@ -153,7 +153,7 @@ protected: }; /** Set the fixed distance with two bodies */ -class PhysicsJointDistance : public PhysicsJoint +class CC_DLL PhysicsJointDistance : public PhysicsJoint { public: static PhysicsJointDistance* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2); @@ -170,7 +170,7 @@ protected: }; /** Connecting two physics bodies together with a spring. */ -class PhysicsJointSpring : public PhysicsJoint +class CC_DLL PhysicsJointSpring : public PhysicsJoint { public: static PhysicsJointSpring* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2, float stiffness, float damping); @@ -194,7 +194,7 @@ protected: }; /** Attach body a to a line, and attach body b to a dot */ -class PhysicsJointGroove : public PhysicsJoint +class CC_DLL PhysicsJointGroove : public PhysicsJoint { public: static PhysicsJointGroove* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& grooveA, const Vec2& grooveB, const Vec2& anchr2); @@ -215,7 +215,7 @@ protected: }; /** Likes a spring joint, but works with rotary */ -class PhysicsJointRotarySpring : public PhysicsJoint +class CC_DLL PhysicsJointRotarySpring : public PhysicsJoint { public: static PhysicsJointRotarySpring* construct(PhysicsBody* a, PhysicsBody* b, float stiffness, float damping); @@ -236,7 +236,7 @@ protected: }; /** Likes a limit joint, but works with rotary */ -class PhysicsJointRotaryLimit : public PhysicsJoint +class CC_DLL PhysicsJointRotaryLimit : public PhysicsJoint { public: static PhysicsJointRotaryLimit* construct(PhysicsBody* a, PhysicsBody* b, float min, float max); @@ -256,7 +256,7 @@ protected: }; /** Works like a socket wrench. */ -class PhysicsJointRatchet : public PhysicsJoint +class CC_DLL PhysicsJointRatchet : public PhysicsJoint { public: static PhysicsJointRatchet* construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratchet); @@ -277,7 +277,7 @@ protected: }; /** Keeps the angular velocity ratio of a pair of bodies constant. */ -class PhysicsJointGear : public PhysicsJoint +class CC_DLL PhysicsJointGear : public PhysicsJoint { public: static PhysicsJointGear* construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratio); @@ -296,7 +296,7 @@ protected: }; /** Keeps the relative angular velocity of a pair of bodies constant */ -class PhysicsJointMotor : public PhysicsJoint +class CC_DLL PhysicsJointMotor : public PhysicsJoint { public: static PhysicsJointMotor* construct(PhysicsBody* a, PhysicsBody* b, float rate); diff --git a/cocos/physics/CCPhysicsShape.h b/cocos/physics/CCPhysicsShape.h index c8921b0430..7f14066595 100644 --- a/cocos/physics/CCPhysicsShape.h +++ b/cocos/physics/CCPhysicsShape.h @@ -38,7 +38,7 @@ class PhysicsBody; class PhysicsBodyInfo; -typedef struct PhysicsMaterial +typedef struct CC_DLL PhysicsMaterial { float density; ///< The density of the object. float restitution; ///< The bounciness of the physics body. @@ -62,7 +62,7 @@ const PhysicsMaterial PHYSICSSHAPE_MATERIAL_DEFAULT(0.0f, 0.5f, 0.5f); /** * @brief A shape for body. You do not create PhysicsWorld objects directly, instead, you can view PhysicsBody to see how to create it. */ -class PhysicsShape : public Ref +class CC_DLL PhysicsShape : public Ref { public: enum class Type @@ -192,7 +192,7 @@ protected: }; /** A circle shape */ -class PhysicsShapeCircle : public PhysicsShape +class CC_DLL PhysicsShapeCircle : public PhysicsShape { public: static PhysicsShapeCircle* create(float radius, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vec2& offset = Vec2(0, 0)); @@ -219,7 +219,7 @@ protected: }; /** A polygon shape */ -class PhysicsShapePolygon : public PhysicsShape +class CC_DLL PhysicsShapePolygon : public PhysicsShape { public: static PhysicsShapePolygon* create(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); @@ -243,7 +243,7 @@ protected: }; /** A box shape */ -class PhysicsShapeBox : public PhysicsShapePolygon +class CC_DLL PhysicsShapeBox : public PhysicsShapePolygon { public: static PhysicsShapeBox* create(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); @@ -260,7 +260,7 @@ protected: }; /** A segment shape */ -class PhysicsShapeEdgeSegment : public PhysicsShape +class CC_DLL PhysicsShapeEdgeSegment : public PhysicsShape { public: static PhysicsShapeEdgeSegment* create(const Vec2& a, const Vec2& b, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); @@ -281,7 +281,7 @@ protected: }; /** An edge polygon shape */ -class PhysicsShapeEdgePolygon : public PhysicsShape +class CC_DLL PhysicsShapeEdgePolygon : public PhysicsShape { public: static PhysicsShapeEdgePolygon* create(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); @@ -301,7 +301,7 @@ protected: }; /** An edge box shape */ -class PhysicsShapeEdgeBox : public PhysicsShapeEdgePolygon +class CC_DLL PhysicsShapeEdgeBox : public PhysicsShapeEdgePolygon { public: static PhysicsShapeEdgeBox* create(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 0, const Vec2& offset = Vec2::ZERO); @@ -318,7 +318,7 @@ protected: }; /** a chain shape */ -class PhysicsShapeEdgeChain : public PhysicsShape +class CC_DLL PhysicsShapeEdgeChain : public PhysicsShape { public: static PhysicsShapeEdgeChain* create(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); diff --git a/cocos/physics/CCPhysicsWorld.h b/cocos/physics/CCPhysicsWorld.h index e091017426..8c3c9a3528 100644 --- a/cocos/physics/CCPhysicsWorld.h +++ b/cocos/physics/CCPhysicsWorld.h @@ -31,7 +31,7 @@ #include "base/CCVector.h" #include "base/CCRef.h" #include "math/CCGeometry.h" - +#include "physics/CCPhysicsBody.h" #include NS_CC_BEGIN @@ -80,7 +80,7 @@ typedef PhysicsQueryRectCallbackFunc PhysicsQueryPointCallbackFunc; /** * @brief An PhysicsWorld object simulates collisions and other physical properties. You do not create PhysicsWorld objects directly; instead, you can get it from an Scene object. */ -class PhysicsWorld +class CC_DLL PhysicsWorld { public: static const int DEBUGDRAW_NONE; ///< draw nothing