project2D/Wall.cpp
//--------------------------------------------------------------------------------------
// Default Constructor.
//
// Param: 
//		textureUrl: Takes in a char for specifying a texture url in texture file location.
//		pos: Vector2 for the position of the object.
//		size: Vector2 for size of the object.
//--------------------------------------------------------------------------------------
Default Constructor.
Param:
textureUrl: Takes in a char for specifying a texture url in texture file location.
pos: Vector2 for the position of the object.
size: Vector2 for size of the object.
Default Constructor . Param : textureUrl : Takes in a char for specifying a texture url in texture file location . pos : Vector2 for the position of the object . size : Vector2 for size of the object .
Wall::Wall(char* textureUrl, Vector2 pos, Vector2 size) : Entity(textureUrl)
{
	CollisionManager* collider = CollisionManager::GetInstance();
	collider->AddObject(this);
	this->size = size;
	Matrix3 temp;
	temp.setPostionv(pos);
	localTransform = localTransform * temp;
	updateGlobalTransform();
	boundingBox.MoveTo(CastTo<Vector3>(GetPosition()));
	m_Collider.m_TL = Vector2(-size.x * 0.5f, -size.y * 0.5f);
	m_Collider.m_BR = Vector2(size.x * 0.5f, size.y * 0.5f);
	this->SetType(WALL);
}
Wall :: Wall ( char * textureUrl , Vector2 pos , Vector2 size ) : Entity ( textureUrl ) { CollisionManager * collider = CollisionManager :: GetInstance ( ) ; collider -> AddObject ( this ) ; this -> size = size ; Matrix3 temp ; temp . setPostionv ( pos ) ; localTransform = localTransform * temp ; updateGlobalTransform ( ) ; boundingBox . MoveTo ( CastTo < Vector3 > ( GetPosition ( ) ) ) ; m_Collider . m_TL = Vector2 ( - size . x * 0.5f , - size . y * 0.5f ) ; m_Collider . m_BR = Vector2 ( size . x * 0.5f , size . y * 0.5f ) ; this -> SetType ( WALL ) ; }
Default Constructor.
Default Constructor .
// Create a collidable object for walls. // Set the position of walls using a matrix3 // Bind the boundingbox with the walls. (for SAT collision.) // Bind the boundingbox with the walls. (for AABB collision.) // Set the type of object to wall