Mercurial > hg > Members > e075743
view src/MovableObject.h @ 10:5727d511a13a
add src in Martial Project Xcode.
author | tokumoritaichirou@nw0743.st.ie.u-ryukyu.ac.jp |
---|---|
date | Wed, 03 Feb 2010 03:39:04 +0900 |
parents | |
children |
line wrap: on
line source
/* * MovableObject.h * Martial * * Created by ryoma on 10/01/23. * Copyright 2010 琉球大学. All rights reserved. * */ /*! @class MovableObject @abstract SceneGraph上の更新が行なわれるオブジェクト @discussion (キャラクタ,弾丸などSceneGraph上のノード) */ #ifndef _MOVABLE_OBJECT_H_ #define _MOVABLE_OBJECT_H_ class MovableObject { protected: /*! @var name @abstract 物体の名前 */ char* name; /*! @var position @abstract 物体の座標 */ osg::Vec3 position; /*! @var velocity @abstract 物体の速度 */ osg::Vec3 velocity; /*! @var acceleration @abstract 物体の加速度 */ osg::Vec3 acceleration; /*! @var angularVelocity @abstract 物体の角速度 */ osg::Vec3 angularVelocity; /*! @var direction @abstract 物体の向いてる方向(ラジアン) */ osg::Vec3 direction; /*! @var defaultDirection @abstract 物体のデフォルトの向き(ラジアン) */ osg::Vec3 defaultDirection; /*! @var node @abstract osgで表示するノード */ osg::Node* node; /*! @var scale @abstract ノードのレンダリングスケール */ osg::Vec3 scale; /*! @var weight @abstract ノードの重量(重力処理、衝突処理で使用?) */ osg::Vec3 weight; /*! @var mfrom @abstract osgの描画情報. 位置,スケール,角度を行列で表す */ osg::MatrixTransform* mform; public: MovableObject(char* name = "MovableObject"); MovableObject(osg::Node* _node = NULL, char* = "MovableObject"); void move(osg::Vec3 s); void rotate(osg::Vec3 r); void accelerate(osg::Vec3 a); void setPos(osg::Vec3 p); void setVel(osg::Vec3 v); void setAcc(osg::Vec3 a); void setDir(osg::Vec3 r); void setAngularVelocity(osg::Vec3 r); void setDefaultDirection(osg::Vec3 r); void setScale(osg::Vec3 s); void modifyForm(); osg::Vec3 getPos(); osg::Vec3 getVel(); osg::Vec3 getAcc(); osg::Vec3 getDir(); osg::Vec3 getDefaultDirection(); osg::NodePathList* getNodePath(); float getRadius(); char* getName(); virtual void init(); virtual void frame(); virtual void checkCollision(); virtual void collision(osg::Vec3 pos, osg::Vec3 reaction); virtual osg::MatrixTransform* getForm(); virtual void dump(); }; #endif