void BACIMonitor::setTriggerTime(const ACS::TimeInterval& _triggerTime) { ACS_TRACE("baci::BACIMonitor::setTriggerTime"); if (_triggerTime != triggerTime_m) { if (_triggerTime<=0) { triggerTime_m=0; } else if (_triggerTime < minTriggerTime_m) { triggerTime_m=minTriggerTime_m; } else { triggerTime_m=_triggerTime; } setLastTime(getTimeStamp()-getTriggerTime()); if((triggerOnValue_m == true || triggerOnValuePercent_m == true) && triggerTime_m > 0) deltaValueAndTimerInteraction_m = true; else deltaValueAndTimerInteraction_m = false; monitorStateChanged(); property_mp->updateMonitorStates(); } }
//-------------------------------------------------------------- void BCWave::update(const float fDelta) { if(!_bStart) { return; } _DegreeDelta = 360 / getTriggerTime(); _Degree += _DegreeDelta * fDelta; if(_Degree >= 360) { _Degree -= 360; } float fSDegree_ = _Degree; for(int idx_ = 0; idx_ < cWAVE_DENSITY; idx_++) { _WavePosList[idx_].y = 0; for(auto& Wave_ : _WaveGenerator) { _WavePosList[idx_].y += Wave_.getValue(fSDegree_); } fSDegree_ += _DegreeInterval; } }
//-------------------------------------------------------------- void BCOpen::open() { _AnimOpenDist.setDuration(getTriggerTime()); _fOpenAngle = ofRandom(0, 180); _fOpenDist = cCANVAS_WIDTH; _AnimOpenDist.animateFromTo(0, 1); _iColorFlag *= -1; }
void FutureEvent::toPDDL(std::ostream & os) const { size_t count = boolean_fluents.size()+numerical_fluents.size()+object_fluents.size(); if (count == 0) { return; } string indent = " "; bool break_lines = count > 1; os << indent << "(at "<<getTriggerTime()<<" "; if (count > 1) { os << "(and "; } forEach (const PredicateBooleanMap::value_type& fluent, boolean_fluents) { if(fluent.second) { if (break_lines) { os << indent << indent; } os << fluent.first; if (break_lines) { os << std::endl; } } } forEach (const PredicateDoubleMap::value_type& fluent, numerical_fluents) { os << indent << indent << "(= "<<fluent.first << " " << fluent.second << ")"; if (break_lines) { os << std::endl; } }
//----------------------------------------------------------------------------- // // VMotionTrack::getObjectSpeed(); // // Determine the Speed that an object must move at to travel over the segment // length of the Path. // //----------------------------------------------------------------------------- F32 VMotionEvent::getObjectSpeed( void ) { // Fetch Parent Track. VMotionTrack *track; if ( !getTrack( track ) ) { // Invalid Track. return 0.f; } // Fetch Path & Reference Object. VTorque::PathObjectType *path = track->getPath(); VTorque::SceneObjectType *object = getSceneObject(); if ( !path || !object ) { // Invalid Object(s). return 0.f; } // Fetch Node Index. const S32 &srcNodeIndex = getNodeIndex( ( isControllerPlayingForward() ) ? 0 : -1 ); // Fetch the Next Event. VEvent *nextEvent = getNextEvent(); // Valid Destination Node? if ( !isControllerLooping() && !nextEvent ) { // No Next Node. return 0.f; } // Valid Next Node? if ( nextEvent ) { // Fetch Segment Length & Duration. const F32 &length = VTorque::getPathNodeLength( path, srcNodeIndex ); const F32 &duration = mAbs( getTriggerTime() - nextEvent->getTriggerTime() ); // Speed = Distance / Duration. return ( length / ( duration / 1000.f ) ); } // Playing Forwards? if ( isControllerPlayingForward() ) { // Fetch the First Event. VEvent *firstEvent = dynamic_cast<VEvent*>( track->getChild() ); // Fetch Segment Length & Duration. const F32 &length = VTorque::getPathNodeLength( path, srcNodeIndex ); const F32 &duration = ( getControllerDuration() - getTriggerTime() ) + firstEvent->getTriggerTime(); // Speed = Distance / Duration. return ( length / ( duration / 1000.f ) ); } // Fetch the Last Event. VEvent *lastEvent = dynamic_cast<VEvent*>( track->getLastChild() ); // Fetch Segment Length & Duration. const F32 &length = VTorque::getPathNodeLength( path, srcNodeIndex ); const F32 &duration = ( getControllerDuration() - lastEvent->getTriggerTime() ) + getTriggerTime(); // Speed = Distance / Duration. return ( length / ( duration / 1000.f ) ); }