void AcWait::Update(ActionLedger* ledger) { if (m_curTicks == -1) m_curTicks = (m_srcId == InvalidLedgerId ? m_waitTicks : ToTicks(ledger->GetFloat(m_srcId))); else if (m_curTicks > 0) m_curTicks--; }
AcWait::AcWait(Seconds_t waitTime) : m_waitTicks(ToTicks(waitTime)) , m_curTicks(-1) , m_srcId(InvalidLedgerId) { }
void ProcEcho::put(XPoint point,uint32 delay_msec,TransIndex idx,Packet<uint8> proc_packet,PtrLen<const uint8> server_info) { Packet<uint8,Ext> packet=proc_packet.pushExt<Ext>(); Ext *ext=packet.getExt(); ext->idx=idx; ext->packet=packet; ext->server_info=server_info; uint32 delay_tick=ToTicks(delay_msec); add(point,delay_tick,ext); }
void AcInvoke::Update(ActionLedger* ledger) { Actor* actor = ledger->GetActorReference("$this"); if (actor == nullptr) return; ActorSequencer* sequencer = actor->GetSequencer(0); if (sequencer == nullptr) return; Seconds_t seconds = ledger->GetFloat(m_ledgerId); Ticks_t ticks = ToTicks(seconds); sequencer->Invoke(m_listId, ticks); }
void AcLerpVector::Update(ActionLedger* ledger) { Ticks_t ticks = ToTicks(ledger->GetFloat(m_srcTime)); if (m_curTicks == -1) m_curTicks = ticks; else if (m_curTicks > 0) m_curTicks--; float t = static_cast<float>(ticks - m_curTicks); if (ticks > 0) t /= ticks; const Vector3f start = ledger->GetVector(m_srcPointA); const Vector3f end = ledger->GetVector(m_srcPointB); const Vector3f result = start + (end - start) * t; ledger->SetVector(m_destId, result); }