On Mon, 2010-03-01 at 04:36 -0800, cheribhai wrote:
>
> Hello,
> A couple of things I noticed in the 'do_update' function of the
> time_sensor_node class (comments are based on version 0.18.5).
>
> 1)The VRML97 spec states that "A TimeSensor node can be set up to be active
> at read time by specifying loop TRUE (not the default) and stopTime less
> than or equal to startTime (satisfied by the default values). ", but one of
> the checks to make the node active is
> 'this->stop_time_.sftime::value() < this->start_time_.value()'.
> Should this not be
> 'this->stop_time_.sftime::value() <= this->start_time_.value()'.
Yes, I believe you're right; except we want to use fless_equal here.
> 2)The spec also states that "If an active time-dependent node receives a
> set_loop FALSE event, execution continues until the end of the current cycle
> or until stopTime (if stopTime > startTime), whichever occurs first." The
> code currently works such that the above is true only if we are in the first
> cycle. After the first one is over the exectution jumps directly to the end
> of the cycle in the next simulation tick instead of continuing to the end of
> the current cycle. This is affected by the check,
> (!this->loop_.sfbool::value() && fless_equal(this->start_time_.value()
> + cycleInt, timeNow.value())).
>
> I have attempted to fix this but before I provide the fix, I just wanted to
> be sure that this is truly an error (and that I am not mistaken).
I think you're right here as well.
Can you please file a bug in trac and attach a patch?
--
Braden McDaniel <br...@en...>
|