PHYSICSENGINEINIT (Compact 2013)
3/28/2014
This structure describes the initialization parameters for a physics engine object. To create a physics engine, you must pass a pointer to this structure to CreatePhysicsEngine.
Syntax
typedef struct tagPHYSICSENGINEINIT {
DWORD cbSize;
DWORD dwEngineType;
DWORD dwFlags;
LONG lInitialVelocity;
DWORD dwInitialAngle;
BYTE bXAxisMovementMode;
BYTE bXAxisBoundaryMode;
BYTE bYAxisMovementMode;
BYTE bYAxisBoundaryMode;
RECT rcBoundary;
SIZE sizeView;
POINT ptInitialPosition;
SIZE sizeItem;
} PHYSICSENGINEINIT;
Members
- cbSize
Specifies the size of the PHYSICSENGINEINIT structure in bytes. Set this value tosizeof(PHYSICSENGINEINIT)
.
- dwEngineType
Reserved; set to 0 (zero).
dwFlags
Specifies the flags that control the behavior of the engine. The following values are valid:- 0 (zero)
Default mode.
- PHYSICSENGINE_FLAG_USERTIME
User-specified time mode.
In default mode, the physics engine reads the time from the system clock.
In user specified time mode, you must call SetPhysicsEngineUserTime to set the time.
- 0 (zero)
- lInitialVelocity
Specifies the initial velocity of the touch gesture animation in pixels per second.
- dwInitialAngle
Specifies the initial angle that the animation occurs at. You must specify the angle as a value in the range 0 to 65536, where 0 is -2pi radians, pointing east, and 65536 is +2pi radians. Angles increase in a counter-clockwise direction.
- bXAxisMovementMode
Specifies the x-axis movement mode. Set this value to PHYSICSENGINE_MOVEMENT_MODE_DECELERATE.
bXAxisBoundaryMode
Specifies the animation behavior when the animation reaches the x-axis boundary. The following values are valid:- PHYSICSENGINE_BOUNDARY_MODE_NONE
No animation.
- PHYSICSENGINE_BOUNDARY_MODE_RUBBERBAND
Rubber band animation.
- PHYSICSENGINE_BOUNDARY_MODE_BOUNCE
Bounce animation.
- PHYSICSENGINE_BOUNDARY_MODE_NONE
- bYAxisMovementMode
Specifies the y-axis movement mode. Set this value to PHYSICSENGINE_MOVEMENT_MODE_DECELERATE.
bYAxisBoundaryMode
Specifies the animation behavior when the animation reaches the y-axis boundary. The following values are valid:- PHYSICSENGINE_BOUNDARY_MODE_NONE
No animation.
- PHYSICSENGINE_BOUNDARY_MODE_RUBBERBAND
Rubber band animation.
- PHYSICSENGINE_BOUNDARY_MODE_BOUNCE
Bounce animation.
- PHYSICSENGINE_BOUNDARY_MODE_NONE
- rcBoundary
Specifies a rectangle that defines the boundary. The boundary represents the entire user control.
- sizeView
Specifies the size of the viewable region.
- ptInitialPosition
Specifies the initial position of the top-left corner of the viewable region.
- sizeItem
Specifies the size of an item in the control. The physics engine uses the size to determine animation stopping points. The physics engine only stops an animation on item boundaries. An item size that is less than 1 in either dimension is treated as 1. If you specify an item size of 1, the physics engine can stop at any point on an axis.
Remarks
If any member of the structure contains invalid data, CreatePhysicsEngine returns E_INVALIDARG.
Requirements
Header |
physicsengine.h, |
sysgen |
SYSGEN_PHYSICSENGINE |
See Also
Reference
Physics Engine Structures
CreatePhysicsEngine
Touch Gestures Physics Engine Reference