/** * Apply a force to an entity with physics component. * * @param force The world force vector, usually in Newtons (N) * @param relativePoint The point where the force is applied relative to the body origin * @param linkedComponent The force is applied as long as the corresponding entity has this * component * @return The com.uwsoft.editor.renderer.systems.action.data.ForceData object */ public static ForceData force( Vector2 force, Vector2 relativePoint, Class<? extends Component> linkedComponent) { ForceData forceData = force(force, relativePoint); forceData.linkedComponentMapper = ComponentMapper.getFor(linkedComponent); return forceData; }
/** * Apply a force to an entity with physics component. The force is applied as long as the * corresponding entity as a physics component. * * @param force The world force vector, usually in Newtons (N) * @param relativePoint The point where the force is applied relative to the body origin * @return The com.uwsoft.editor.renderer.systems.action.data.ForceData object */ public static ForceData force(Vector2 force, Vector2 relativePoint) { initialize(ForceAction.class); ForceData forceData = new ForceData(force, relativePoint); forceData.logicClassName = ForceAction.class.getName(); return forceData; }