Working on lights, I'm conceeding and just using a fixed array. I think it will be faster in the long run, as I won't have to rebind the lights when I add/remove one. Also wrestling with really lame compiler erros with these templated pointers
parent
0047db0a65
commit
bfb6d922a3
@ -1,18 +1,60 @@
|
|||||||
#include "LightHandle.h"
|
#include "LightHandle.h"
|
||||||
#include "LightController.h"
|
#include "LightController.h"
|
||||||
|
|
||||||
LightHandle::LightHandle() {
|
|
||||||
|
|
||||||
// init an empty light
|
LightHandle::LightHandle(LightController *const light_controller, unsigned int light_id, LightPrototype light_prototype, std::unique_ptr<PackedData> data_reference) :
|
||||||
LightController::PackedData data;
|
light_controller_ref(light_controller), data_reference(std::move(data_reference)) {
|
||||||
data.direction_cartesian = sf::Vector3f(0, 0, 0);
|
|
||||||
data.position = sf::Vector3f(0, 0, 0);
|
friction_coefficient = light_prototype.friction;
|
||||||
data.rgbi = sf::Vector4f(0, 0, 0, 0);
|
default_impulse = light_prototype.impulse;
|
||||||
|
movement = light_prototype.movement;
|
||||||
//light_controller.create_light(data, light_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LightHandle::~LightHandle() {
|
LightHandle::~LightHandle() {
|
||||||
|
|
||||||
|
// Sanitize data here, or in the controller?
|
||||||
|
data_reference->direction_cartesian = sf::Vector3f(0, 0, 0);
|
||||||
|
data_reference->position = sf::Vector3f(0, 0, 0);
|
||||||
|
data_reference->rgbi = sf::Vector4f(0, 0, 0, 0);
|
||||||
|
|
||||||
|
light_controller_ref->remove_light(light_id);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LightHandle::set_friction(float friction)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LightHandle::set_impulse(float impulse)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LightHandle::set_movement(sf::Vector3f movement)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LightHandle::add_movement(sf::Vector3f movement)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LightHandle::set_position(sf::Vector3f position)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LightHandle::set_direction(sf::Vector3f direction)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LightHandle::set_rgbi(sf::Vector4f rgbi)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in new issue