Пример #1
0
Asteroid::Asteroid(Game& game) : Super(game)
{
    auto mesh = MeshComponent::Create(*this);
    auto meshPtr = game.GetAssetCache().Load<Mesh>("Meshes/AsteroidMesh.itpmesh2");
    mesh->SetMesh(meshPtr);
    
    auto movement = MoveComponent::Create(*this, Component::PreTick);
    movement->SetLinearSpeed(150.0f);
    movement->SetLinearAxis(1.0f);
    
    SetRotation(Random::GetRotation());
	SetScale( 0.1f );
}
Пример #2
0
Laser::Laser(Game & game) :Actor(game)
{
	//Create a sprite component
	auto sprite = SpriteComponent::Create(*this);
	auto assetCache = game.GetAssetCache();
	auto texture = assetCache.Load<Texture>("Textures/Laser.png");
	sprite->SetTexture(texture);

	//Set Movement
	auto move = MoveComponent::Create(*this, Component::PreTick);
	move->SetLinearSpeed(600.0f);
	move->SetLinearAxis(1.0f);
	
	//Set SphereCollision
	auto coll = SphereCollision::Create(*this);
	coll->RadiusFromTexture(texture);
	coll->SetScale(0.9f);

}
Пример #3
0
		dHexapodEffector (NewtonInverseDynamics* const invDynSolver, void* const invDynNode, NewtonBody* const referenceBody, const dMatrix& attachmentMatrixInGlobalSpace)
			:dCustomInverseDynamicsEffector (invDynSolver, invDynNode, referenceBody, attachmentMatrixInGlobalSpace)
		{
			SetLinearSpeed(1.0f);
		}
		dKukaEffector(NewtonInverseDynamics* const invDynSolver, void* const invDynNode, NewtonBody* const referenceBody, const dMatrix& attachmentMatrixInGlobalSpace)
			:dCustomInverseDynamicsEffector(invDynSolver, invDynNode, referenceBody, attachmentMatrixInGlobalSpace)
		{
			SetLinearSpeed(2.0f);
			SetMaxLinearFriction (armRobotConfig[4].m_mass * DEMO_GRAVITY * 50.0f);
		}