예제 #1
0
 Polygon::Polygon(vec2* aVertices, unsigned int aCount) : GameObject("Polygon"),
     m_Shader(nullptr),
     m_AnchorPoint(0.0f, 0.0f),
     m_AnchorLocation(0.0f, 0.0f),
     m_Color(Color::BlueColor()),
     m_RenderMode(GL_TRIANGLE_FAN),
     m_IsFilled(true),
     m_PointSize(1.0f),
     m_TweenAnchorX(),
     m_TweenAnchorY(),
     m_TweenAlpha(),
     m_VertexArrayObject(0),
     m_VertexBufferObject(0)
 {
     //Set the shader as the default passthrough shader
     SetShader(ServiceLocator::GetShaderManager()->GetPassthroughShader());
     
     //Set the vertices
     SetVertices(aVertices, aCount);
     
     //Intialize the position and angle
     SetLocalPosition(vec2(0.0f, 0.0f));
     SetLocalAngle(0.0f);
     
     //Set the model matrix to dirty
     ModelMatrixIsDirty(true);
 }
예제 #2
0
 Polygon::Polygon(vec2* aVertices, unsigned int aCount, Shader* aShader) : GameObject("Polygon"),
     m_Shader(aShader),
     m_AnchorPoint(0.0f, 0.0f),
     m_AnchorLocation(0.0f, 0.0f),
     m_Color(Color::BlackColor()),
     m_RenderMode(GL_TRIANGLE_FAN),
     m_IsFilled(true),
     m_PointSize(1.0f),
     m_TweenAnchorX(),
     m_TweenAnchorY(),
     m_TweenAlpha(),
     m_VertexArrayObject(0),
     m_VertexBufferObject(0)
 {
     //Set the vertices
     SetVertices(aVertices, aCount);
 
     //Intialize the position and angle
     SetLocalPosition(vec2(0.0f, 0.0f));
     SetLocalAngle(0.0f);
     
     //Set the model matrix to dirty
     ModelMatrixIsDirty();
 }
예제 #3
0
 Polygon::Polygon(const string& aType) : GameObject(aType == "" ? "Polygon" : aType),
     m_Shader(nullptr),
     m_AnchorPoint(0.0f, 0.0f),
     m_AnchorLocation(0.0f, 0.0f),
     m_Color(Color::BlueColor()),
     m_RenderMode(GL_TRIANGLE_FAN),
     m_IsFilled(true),
     m_PointSize(1.0f),
     m_TweenAnchorX(),
     m_TweenAnchorY(),
     m_TweenAlpha(),
     m_VertexArrayObject(0),
     m_VertexBufferObject(0)
 {
     //Set the shader as the default passthrough shader
     SetShader(ServiceLocator::GetShaderManager()->GetPassthroughShader());
     
     //Intialize the position and angle
     SetLocalPosition(0.0f, 0.0f);
     SetLocalAngle(0.0f);
     
     //Set the model matrix to dirty
     ModelMatrixIsDirty();
 }
예제 #4
0
 void PhysicsObject::SetTransform(float aX, float aY, float aAngle, double aDuration, EasingFunction aEasing, bool aReverse, int aRepeatCount)
 {
     SetLocalX(aX, aDuration, aEasing, aReverse, aRepeatCount);
     SetLocalY(aY, aDuration, aEasing, aReverse, aRepeatCount);
     SetLocalAngle(aAngle, aDuration, aEasing, aReverse, aRepeatCount);
 }