project2D/Bullet.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.
//		rad: float 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.
rad: float 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 . rad : float for size of the object .
Bullet::Bullet(char* textureUrl, Vector2 pos, float rad) : Entity(textureUrl)
{
	CollisionManager* collider = CollisionManager::GetInstance();
	collider->AddObject(this);
	this->rad = rad;
	speed = 250;
	m_Collider.m_rad = rad;
	this->SetType(BULLET);
	Matrix3 temp;
	temp.setPostionv(pos);
	localTransform = localTransform * temp;
	updateGlobalTransform();
}
Bullet :: Bullet ( char * textureUrl , Vector2 pos , float rad ) : Entity ( textureUrl ) { CollisionManager * collider = CollisionManager :: GetInstance ( ) ; collider -> AddObject ( this ) ; this -> rad = rad ; speed = 250 ; m_Collider . m_rad = rad ; this -> SetType ( BULLET ) ; Matrix3 temp ; temp . setPostionv ( pos ) ; localTransform = localTransform * temp ; updateGlobalTransform ( ) ; }
Default Constructor.
Default Constructor .
// Create a collidable object for Bullets. // Initialize rad and speed // Bind the boundingbox with the bullet rad. (for AABB collision.) // Set the type of object to Bullet // Set the position of Bullets using a matrix3