polar snapping now very goood!
This commit is contained in:
@@ -21,7 +21,7 @@ class SignalManager{
|
||||
std::mutex *mutex;
|
||||
GraphManager *gm;
|
||||
|
||||
std::vector<std::shared_ptr<Signal>> signals;
|
||||
VEC_SPTR_Signal signals;
|
||||
|
||||
bool loop = true;
|
||||
bool play = false;
|
||||
@@ -57,9 +57,9 @@ class SignalManager{
|
||||
loop = false;
|
||||
}
|
||||
|
||||
void addSignalAtNode(std::shared_ptr<Node> node){
|
||||
void addSignalAtNode(SPTR_Node node){
|
||||
Color c = {(unsigned char)(20 + (rand() % 200)), 100, (unsigned char)(20 + (int)(rand() % 200)), 200};
|
||||
signals.emplace_back(std::make_shared<Signal>(node->position, 8.0f, 0, c)); // position + 1 or else it does not render. why? no idea!
|
||||
signals.emplace_back(std::make_shared<Signal>(node->position + Vec2D<float>{0.5f, 0.5f}, 8.0f, 0, c)); // position + 1 or else it does not render. why? no idea!
|
||||
signals.back()->next = node;
|
||||
signals.back()->last = node;
|
||||
signals.back()->start = node;
|
||||
@@ -80,10 +80,10 @@ class SignalManager{
|
||||
s->direction = (s->next->position - s->position).norm();
|
||||
s->update(diff.count());
|
||||
if(s->position.dist(s->next->position) < 0.6f) {
|
||||
std::shared_ptr<Node> next_node = gm->next(s->next, s->last);
|
||||
SPTR_Node next_node = gm->next(s->next, s->last);
|
||||
s->next->trigger();
|
||||
|
||||
if(next_node != s->next && next_node != std::shared_ptr<Node>(nullptr) && s->next->getNodeType() == NodeType::MIDINODE) {
|
||||
if(next_node != s->next && next_node != SPTR_Node(nullptr) && s->next->getNodeType() == NodeType::MIDINODE) {
|
||||
auto midinode = std::dynamic_pointer_cast<MidiNode>(s->next);
|
||||
for(auto &m : midinode->midi_outs){
|
||||
if(m.second.enabled) {
|
||||
|
||||
Reference in New Issue
Block a user