From 2239b624a8ec49e69663190ba6ae0c6299cfa8c4 Mon Sep 17 00:00:00 2001 From: songchengjiang Date: Wed, 26 Aug 2015 16:19:30 +0800 Subject: [PATCH] add annotations --- cocos/physics3d/CCPhysics3DObject.h | 13 +++++++++++-- cocos/physics3d/CCPhysicsSprite3D.h | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cocos/physics3d/CCPhysics3DObject.h b/cocos/physics3d/CCPhysics3DObject.h index f2e7597e79..2f7d6e1d5f 100644 --- a/cocos/physics3d/CCPhysics3DObject.h +++ b/cocos/physics3d/CCPhysics3DObject.h @@ -365,7 +365,7 @@ protected: */ struct CC_DLL Physics3DColliderDes { - Physics3DShape* shape; + Physics3DShape* shape; // shape pointer cocos2d::Mat4 originalTransform; bool isTrigger; //is it a trigger? float friction; @@ -390,14 +390,20 @@ struct CC_DLL Physics3DColliderDes }; /** -* @brief Inherit from Physics3DObject, the main class for Colliders +* @brief Inherit from Physics3DObject, the main class for Colliders. */ class CC_DLL Physics3DCollider : public Physics3DObject { public: + /** + * Creates a Physics3DCollider with Physics3DColliderDes. + * + * @return An autoreleased Physics3DCollider object. + */ static Physics3DCollider* create(Physics3DColliderDes *info); + /** Get the pointer of btGhostObject. */ btGhostObject* getGhostObject() const { return _btGhostObject; } /** Set trigger. */ @@ -445,7 +451,10 @@ public: /** Get the world matrix of Physics3DObject. */ virtual cocos2d::Mat4 getWorldTransform() const; + /** Set a callback when trigger enter. */ std::function onTriggerEnter; + + /** Set a callback when trigger exit. */ std::function onTriggerExit; CC_CONSTRUCTOR_ACCESS : diff --git a/cocos/physics3d/CCPhysicsSprite3D.h b/cocos/physics3d/CCPhysicsSprite3D.h index 4596d5c9dc..4d34df22fb 100644 --- a/cocos/physics3d/CCPhysicsSprite3D.h +++ b/cocos/physics3d/CCPhysicsSprite3D.h @@ -50,7 +50,7 @@ public: /** creates a PhysicsSprite3D*/ static PhysicsSprite3D* create(const std::string &modelPath, Physics3DRigidBodyDes* rigidDes, const cocos2d::Vec3& translateInPhysics = cocos2d::Vec3::ZERO, const cocos2d::Quaternion& rotInPhsyics = cocos2d::Quaternion::ZERO); - /** creates a PhysicsSprite3D*/ + /** creates a PhysicsSprite3D as a collider*/ static PhysicsSprite3D* createWithCollider(const std::string &modelPath, Physics3DColliderDes* colliderDes, const cocos2d::Vec3& translateInPhysics = cocos2d::Vec3::ZERO, const cocos2d::Quaternion& rotInPhsyics = cocos2d::Quaternion::ZERO); /** Get the Physics3DObject. */