AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkSprite.SetPhysicsCenterOfMass Method (TAgkPoint)

Sets the center of mass (COM) realtive to the sprite's offset.

Syntax
Pascal
procedure SetPhysicsCenterOfMass(const COM: TAgkPoint); overload;
Parameters 
Description 
const COM: TAgkPoint 
The center of mass point. 

By default the AGK calulates the best location for the COM based on the size and location of all shapes attached to the sprite. Setting it to 0,0 will put the COM on the sprite's offset point (and center of rotation). If the COM is very different from the offset point the sprite may seem unstable as it will behave like an unbalanced spinning top.

Copyright (c) 2012. All rights reserved.