Lights are now working correctly. Need to update the kernel to account for multiple lights, and add sfEventSubscriber to the LightHandler

This commit is contained in:
MitchellHansen
2017-02-11 23:16:09 -08:00
parent 6e0d5814e1
commit e364c5380d
5 changed files with 16 additions and 22 deletions

View File

@@ -35,6 +35,7 @@ struct PackedData {
position(position), direction_cartesian(direction_cartesian), rgbi(rgbi) {
}
PackedData() {};
~PackedData() {};
sf::Vector4f rgbi;
sf::Vector3f position;
sf::Vector3f direction_cartesian;
@@ -50,7 +51,7 @@ public:
LightController(std::shared_ptr<Hardware_Caster> raycaster);
~LightController();
std::unique_ptr<LightHandle> create_light(LightPrototype light_prototype);
std::shared_ptr<LightHandle> create_light(LightPrototype light_prototype);
void remove_light(unsigned int light_index);
void recieve_event(VrEventPublisher* p, std::unique_ptr<vr::Event> event) override;

View File

@@ -55,7 +55,7 @@ public:
private:
LightHandle(LightController *const light_controller, unsigned int light_id, LightPrototype light_prototype, std::unique_ptr<PackedData> data_reference);
LightHandle(LightController *const light_controller, unsigned int light_id, LightPrototype light_prototype, PackedData *const data_reference);
// Reference to the LightController to handle deconstruction and removal using the light_id
LightController *const light_controller_ref;
@@ -67,5 +67,5 @@ private:
sf::Vector3f movement;
// Reference to the packed data in the LightController
std::unique_ptr<PackedData> data_reference;
PackedData *const data_reference;
};