Пример #1
0
BOOL COrnament::UpdateSelf(void)
{
	ASSERT(m_pContext != NULL);

	if (UpdateNeeded())
	{
		// Size the ornament base on position and extent.
			
		// NOTE: The Bounds property is not up to date at this
		// point and should not be used is the SizeContent() method.
		// Furthermore, SizeContent() should not set the Bounds
		// rectangle. Its definition is fixed: Extent+Position-Origin.
		// The bounds rectangle is used as the position where the
		// actual image will be drawn.
			
		SizeContent();
			
		// Update the bounds from the position and extent.
			
		CurrentState()->m_crBounds = CRect(0, 0, CurrentState()->m_czExtent.cx, CurrentState()->m_czExtent.cx)+CurrentState()->m_cpPosition-CurrentState()->m_cpOrigin;
		
		// The size information is now valid for the current properties.
	}
	return TRUE;
}
Пример #2
0
ProxyObject::ProxyObject(ProxyManager *man, const SpaceObjectReference&id)
      : mID(id),
        mManager(man),
        mLocation(Duration::seconds(.1),
                  TemporalValue<Location>::Time::null(),
                  Location(Vector3d(0,0,0),Quaternion(Quaternion::identity()),
                           Vector3f(0,0,0),Vector3f(0,1,0),0),
                  UpdateNeeded()),
        mParentId(SpaceObjectReference::null()) {}