Ejemplo n.º 1
0
//=============================================================================
//=============================================================================
Vehicle::Vehicle(Context* context)
: LogicComponent( context )
, steering_( 0.0f )
{
    // fixed update() for inputs and post update() to sync wheels for rendering
    SetUpdateEventMask( USE_FIXEDUPDATE | USE_POSTUPDATE );
    
    gEngineForce = 0.0f;          //applied force (real time)
    gBreakingForce = 0.0f;        //applied force (real time)
    maxEngineForce = 5000.f;    //this should be engine/velocity dependent
    maxBreakingForce = 500.f;
    
    //gVehicleSteering = 0.0f;
    steeringIncrement = 0.05f;    //amount of applied angular force key:A/D
    steeringClamp = 0.2f;   	 //Don't increase the angle
    wheelRadius = 0.32f;
    wheelWidth = 0.22f;
    wheelFriction = 1000;//BT_LARGE_FLOAT;
    rollInfluence = 0.01f;//1.0f;
    suspensionStiffness = 40.0f;//20.f;
    suspensionDamping = 2.3f;//2.3f;
    suspensionCompression = 4.4f;//4.4f;
    suspensionRestLength = 0.6f;//0.6       // federung
    
    m_vehicleRayCaster = NULL;
    m_vehicle = NULL;
    
    m_vpNodeWheel.Clear();
    
    vehicleGear = 0;
}
Ejemplo n.º 2
0
void WarriorSkill1::Start()
{
	skillSprite_ = (Sprite*)(main_->mySceneNode_->GetComponent<HUD>()->
			hud_->GetChild("skill1", false)->GetChild(0)->GetChild(0));
	SubscribeToEvent(E_HUDBUTT, HANDLER(WarriorSkill1, HandleHudButt));
	SetUpdateEventMask(USE_UPDATE);
}
Ejemplo n.º 3
0
Fish::Fish(Context* context) :
    LogicComponent(context),
    verticalSpeed_{0.0f},
    jumpDelay_{0.0f}
{
    SetUpdateEventMask(USE_UPDATE);
}
Ejemplo n.º 4
0
Vehicle::Vehicle(Context* context) :
    LogicComponent(context),
    steering_(0.0f)
{
    // Only the physics update event is needed: unsubscribe from the rest for optimization
    SetUpdateEventMask(USE_FIXEDUPDATE);
}
RigidBodyMoveTo::RigidBodyMoveTo(Context* context) :
		LogicComponent(context)
{
	isMoving_ = false;
	// Only the physics update event is needed: unsubscribe from the rest for optimization
	SetUpdateEventMask(USE_FIXEDUPDATE);
}
Ejemplo n.º 6
0
Rotator::Rotator(Context* context) :
    LogicComponent(context),
    rotationSpeed_(Vector3::ZERO)
{
    // Only the scene update event is needed: unsubscribe from the rest for optimization
    SetUpdateEventMask(USE_UPDATE);
}
Ejemplo n.º 7
0
Mover::Mover(Context* context) :
    LogicComponent(context),
    moveSpeed_(0.0f),
    rotationSpeed_(0.0f)
{
    // Only the scene update event is needed: unsubscribe from the rest for optimization
    SetUpdateEventMask(USE_UPDATE);
}
Ejemplo n.º 8
0
void RotateTo::Start()
{
	//SubscribeToURHO3D_EVENT(E_SETCLIENTMODELNODE, URHO3D_HANDLER(RotateTo, HandleSetClientModelNode));
	SubscribeToEvent(E_ROTATEMODELNODE, URHO3D_HANDLER(RotateTo, HandleRotateModelNode));

	/*VariantMap vm;
	vm[GetClientModelNode::P_NODE] = node_;
	SendURHO3D_EVENT(E_GETCLIENTMODELNODE, vm);*/

	SetUpdateEventMask(USE_FIXEDUPDATE);
}
Ejemplo n.º 9
0
void RangerSkill4::Start()
{
    skillSprite_ = (Sprite*)(main_->mySceneNode_->GetComponent<HUD>()->
                             hud_->GetChild("skill4", false)->GetChild(0)->GetChild(0));
    SubscribeToEvent(E_HUDBUTT, HANDLER(RangerSkill4, HandleHudButt));
    SetUpdateEventMask(USE_UPDATE);

    XMLFile* xmlFile = main_->cache_->GetResource<XMLFile>("Objects/terriesSnail.xml");
    snail_ = node_->GetScene()->InstantiateXML(xmlFile->GetRoot(),
             Vector3::ZERO, Quaternion::IDENTITY, LOCAL);

    snail_->SetVar("npcType",0);//0 = hero, 1 = terry

    snail_->SetEnabled(false);
}
/// Construct.
CustomLogic::CustomLogic(Context* context) : LogicComponent(context)
{
	SetUpdateEventMask(USE_FIXEDUPDATE | USE_UPDATE);
}
Ejemplo n.º 11
0
Board::Board(Context* context) :
    LogicComponent(context)
{
    SetUpdateEventMask(USE_UPDATE);
}
Ejemplo n.º 12
0
PlanetComponent::PlanetComponent(Context* context) : LogicComponent(context)
{
    SetUpdateEventMask(USE_FIXEDUPDATE | USE_UPDATE);
    SubscribeToEvent(E_POSTRENDERUPDATE, URHO3D_HANDLER(PlanetComponent, HandlePostRenderUpdate));
}
Ejemplo n.º 13
0
FlappyCam::FlappyCam(Context* context) :
    LogicComponent(context)
{
    SetUpdateEventMask(USE_UPDATE);
}
Ejemplo n.º 14
0
void Enchanted::Start()
{
	SetUpdateEventMask(USE_UPDATE);
	//SubscribeToEvent(E_GETCLIENTGRAVITY, HANDLER(Enchanted, HandleGetEnchanted));
}
Ejemplo n.º 15
0
DebugCameraController2D::DebugCameraController2D(Context* context)
    : LogicComponent(context)
{
    SetUpdateEventMask(USE_NO_EVENT);
}