Just small changes

This commit is contained in:
lawnjelly 2020-04-02 13:34:55 +01:00 committed by GitHub
parent 4bfe94b2b1
commit 41972955e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -791,7 +791,13 @@ bool LRoomManager::Light_FindCasters(int lightID)
void LRoomManager::Light_UpdateTransform(LLight &light, const Light &glight) const void LRoomManager::Light_UpdateTransform(LLight &light, const Light &glight) const
{ {
// assert (glight.is_in_tree()); if (!glight.get_parent())
{
WARN_PRINT_ONCE("LRoomManager::Light_UpdateTransform Light is not in tree");
return;
}
// get global transform only works if glight is in the tree
Transform tr = glight.get_global_transform(); Transform tr = glight.get_global_transform();
light.m_Source.m_ptPos = tr.origin; light.m_Source.m_ptPos = tr.origin;
light.m_Source.m_ptDir = -tr.basis.get_axis(2); // or possibly get_axis .. z is what we want light.m_Source.m_ptDir = -tr.basis.get_axis(2); // or possibly get_axis .. z is what we want
@ -908,12 +914,6 @@ int LRoomManager::dynamic_light_register(Node * pLightNode, float radius)
return -1; return -1;
} }
//bool LRoomManager::dynamic_light_register_hint(Node * pLightNode, float radius, Node * pRoom)
//{
// // NYI
// return true;
//}
bool LRoomManager::dynamic_light_unregister(int light_id) bool LRoomManager::dynamic_light_unregister(int light_id)
{ {

View File

@ -97,9 +97,8 @@ public:
// dynamic lights (spot or omni within rooms) // dynamic lights (spot or omni within rooms)
// returns light ID // returns light ID
// int dynamic_light_register(Node * pLightNode, const Vector3 &pos, const Vector3 &dir, float radius); // only lights within the rooms on conversion are supported so far
int dynamic_light_register(Node * pLightNode, float radius); int dynamic_light_register(Node * pLightNode, float radius);
// bool dynamic_light_register_hint(Node * pLightNode, float radius, Node * pRoom);
bool dynamic_light_unregister(int light_id); bool dynamic_light_unregister(int light_id);
int dynamic_light_update(int light_id, const Vector3 &pos, const Vector3 &dir); // returns room within int dynamic_light_update(int light_id, const Vector3 &pos, const Vector3 &dir); // returns room within