#pragma once #include "PVInstance.h" #include "Enum.h" #define _USE_MATH_DEFINES #include namespace B3D { class PartInstance : public PVInstance { public: PartInstance(void); ~PartInstance(void); //Reflective Properties Reflection::ReflectionProperty color; Reflection::ReflectionProperty canCollide; //Surfaces Reflection::ReflectionProperty top, front, right, back, left, bottom; //Shapes Reflection::ReflectionProperty shape; //OnTouch Reflection::ReflectionProperty onTouchAction; Reflection::ReflectionProperty onTouchSound; //Non-Reflective Variables dBodyID physBody; dGeomID physGeom[3]; //Functions //Rendering virtual void PartInstance::postRender(RenderDevice* rd); virtual void render(RenderDevice*); virtual void renderName(RenderDevice*); //Getters Vector3 getPosition(); Vector3 getVelocity(); Vector3 getRotVelocity(); Vector3 getSize(); Box getBox(); Sphere getSphere(); Box getScaledBox(); CoordinateFrame getCFrame(); //OnTouch Getters bool isSingleShot(); int getTouchesToTrigger(); int getUniqueObjectsToTrigger(); int getChangeScore(); float getChangeTimer(); //Setters void setParent(Instance* parent); void setPosition(Vector3); void setVelocity(Vector3); void setRotVelocity(Vector3); void setCFrame(CoordinateFrame); void setCFrameNoSync(CoordinateFrame); void setSize(Vector3); void setShape(Enum::Shape::Value shape); void setChanged(); void setSurface(int face, Enum::SurfaceType::Value surface); void setAnchored(bool anchored); void reflectionNotify(ReflectionProperty* property); bool isAnchored(); float getMass(); bool isDragging(); void setDragging(bool value); //Collision bool collides(PartInstance * part); bool collides(Box); // onTouch void onTouch(); private: //Reflective Properties Reflection::ReflectionProperty anchored; Reflection::ReflectionProperty position; Reflection::ReflectionProperty size; Reflection::ReflectionProperty velocity; Reflection::ReflectionProperty rotVelocity; // OnTouch Reflection::ReflectionProperty singleShot; Reflection::ReflectionProperty touchesToTrigger; Reflection::ReflectionProperty uniqueObjectsToTrigger; Reflection::ReflectionProperty changeScore; Reflection::ReflectionProperty changeTimer; //Non-reflective Variables bool changed; bool dragging; Box itemBox; GLuint glList; bool _touchedOnce; }; }