Point lights
This commit is contained in:
@@ -35,7 +35,7 @@ void HydraActorManager::DeleteActor(HydraID actorID)
|
||||
if(m_actors[actorID] != nullptr)
|
||||
{
|
||||
|
||||
m_actors[actorID]->Delete();
|
||||
GetEngine()->ECS()->DestroyEntity(actorID);
|
||||
_SetActorDeleted(actorID);
|
||||
}
|
||||
|
||||
@@ -194,15 +194,22 @@ void HydraActorManager::SetLinearVelocity(HydraID actor_id, glm::vec3 velocity)
|
||||
void HydraActorManager::SetPositionAndOrientation(HydraID actorID, glm::dvec3 position, glm::vec3 euler_angles, bool ignore_physics)
|
||||
{
|
||||
HydraECS *ecs = GetEngine()->ECS();
|
||||
|
||||
HydraPositionComponent &pos_comp = ecs->GetComponent<HydraPositionComponent>(actorID);
|
||||
pos_comp.position = position;
|
||||
pos_comp.orientation = glm::vec3(euler_angles.x,euler_angles.y,euler_angles.z);
|
||||
|
||||
if(!pos_comp.needs_update)
|
||||
if(ecs->HasComponent<HydraPositionComponent>(actorID))
|
||||
{
|
||||
ecs->GetSystem<HydraTransformSystem>()->UpdateTransform(actorID, ignore_physics);
|
||||
HydraPositionComponent &pos_comp = ecs->GetComponent<HydraPositionComponent>(actorID);
|
||||
pos_comp.position = position;
|
||||
pos_comp.orientation = glm::vec3(euler_angles.x,euler_angles.y,euler_angles.z);
|
||||
|
||||
if(!pos_comp.needs_update)
|
||||
{
|
||||
ecs->GetSystem<HydraTransformSystem>()->UpdateTransform(actorID, ignore_physics);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "HERE";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void HydraActorManager::SetScale(HydraID actor_id, glm::dvec3 scaling)
|
||||
|
||||
Reference in New Issue
Block a user