/// Holds required information to perform an update to box2d /// body of a shape that was altered by an animation effect struct Box2DDynamicUpdateInformation
{ /// reference to the shape that the update belongs to
css::uno::Reference<css::drawing::XShape> mxShape; union {
::basegfx::B2DPoint maPosition;
::basegfx::B2DVector maVelocity; double mfAngle; double mfAngularVelocity; bool mbVisibility;
};
box2DNonsimulatedShapeUpdateType meUpdateType; /// amount of steps to delay the update for int mnDelayForSteps = 0;
};
/** Class that manages the Box2D World
Thisclassisusedwhenthere'saphysicsanimationgoingon, ithandlesthesteppingthroughthebox2dworld,updatingthe shapesinthebox2dworldiftheywerechangedbyongoinganimations.
*/ class box2DWorld
{ private: /// Pointer to the real Box2D World that this class manages
std::unique_ptr<b2World> mpBox2DWorld; /// Scale factor for conversions between LO user space coordinates to Box2D World coordinates double mfScaleFactor; bool mbShapesInitialized; /// Holds whether or not there is a PhysicsAnimation that /// is stepping the Box2D World. Used to create a lock mechanism bool mbHasWorldStepper; /// Flag used to stop overstepping that occurs when a physics /// animation effect transfers step-lock to another one. bool mbAlreadyStepped; /// Number of Physics Animations going on int mnPhysicsAnimationCounter;
std::unordered_map<css::uno::Reference<css::drawing::XShape>, Box2DBodySharedPtr>
mpXShapeToBodyMap;
/** Queue that holds any required information to keep LO animation effects andBox2DWorldinsync
/// Creates a static frame in Box2D world that corresponds to the slide borders void createStaticFrameAroundSlide(const ::basegfx::B2DVector& rSlideSize);
/** Sets shape's corresponding Box2D body to the specified position
/// Queue a rotation update that is simulated as if shape's corresponding box2D body rotated to given angle when processed void queueDynamicRotationUpdate(const css::uno::Reference<css::drawing::XShape>& xShape, constdouble fAngle);
/// Queue an angular velocity update that sets the shape's corresponding box2D body angular velocity to the given value when processed void queueAngularVelocityUpdate(const css::uno::Reference<css::drawing::XShape>& xShape, constdouble fAngularVelocity, constint nDelayForSteps);
/// Queue an collision update that sets the collision of shape's corresponding box2D body when processed void queueShapeVisibilityUpdate(const css::uno::Reference<css::drawing::XShape>& xShape, constbool bVisibility);
/// @return whether shapes in the slide are initialized as Box2D bodies or not bool shapesInitialized(); /// @return whether the Box2D World is initialized or not bool isInitialized() const;
/** Make the shape's corresponding box2D body a dynamic one.
/// Initiate all the shapes in the current slide in the box2DWorld as static ones void initiateAllShapesAsStaticBodies( const slideshow::internal::ShapeManagerSharedPtr& pShapeManager);
/// @return whether the box2DWorld has a stepper or not bool hasWorldStepper() const;
/// Set the flag for whether the box2DWorld has a stepper or not void setHasWorldStepper(constbool bHasWorldStepper);
/// Queue a position update that is simulated as if shape's corresponding box2D body moved to given position when processed void queueDynamicPositionUpdate(const css::uno::Reference<css::drawing::XShape>& xShape, const ::basegfx::B2DPoint& rOutPos);
/// Queue a update that sets the corresponding box2D body's linear velocity to the given value when processed void queueLinearVelocityUpdate(const css::uno::Reference<css::drawing::XShape>& xShape, const ::basegfx::B2DVector& rVelocity, constint nDelayForSteps);
/// Queue an appropriate update for the animation effect that is in parallel with a physics animation void
queueShapeAnimationUpdate(const css::uno::Reference<css::drawing::XShape>& xShape, const slideshow::internal::ShapeAttributeLayerSharedPtr& pAttrLayer, const slideshow::internal::AttributeType eAttrType, constbool bIsFirstUpdate);
/// Queue an appropriate update for a path animation that is in parallel with a physics animation void queueShapePathAnimationUpdate( const css::uno::Reference<css::drawing::XShape>& xShape, const slideshow::internal::ShapeAttributeLayerSharedPtr& pAttrLayer, constbool bIsFirstUpdate);
/// Queue an appropriate update for the animation effect that just ended void queueShapeAnimationEndUpdate(const css::uno::Reference<css::drawing::XShape>& xShape, const slideshow::internal::AttributeType eAttrType);
/** Alert that a physics animation effect has ended
/// Class that manages a single box2D Body class box2DBody
{ private: /// Pointer to the body that this class manages
std::shared_ptr<b2Body> mpBox2DBody; /// Scale factor for conversions between LO user space coordinates to Box2D World coordinates double mfScaleFactor;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
(vorverarbeitet am 2026-09-30)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.