Moves force field to world position x,y,z (updates center point of effect area).
Takes handle (force field handle from b3dCreateForceField), x/y/z (new position in world space where force field is centered).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
handleInt
xDouble
yDouble
zDouble
Returns
Void
Quick Summary
Moves force field to world position x,y,z (updates center point of effect area).
Takes handle (force field handle from b3dCreateForceField), x/y/z (new position in world space where force field is centered).
Returns nothing.
Technical Exegesis...
Moves force field to world position x,y,z (updates center point of effect area). Takes handle (force field handle from b3dCreateForceField), x/y/z (new position in world space where force field is centered). Returns nothing. Sets ff.position, updates force field center for next physics update. Use to move force fields dynamically, reposition hazards, or animate force field locations.
This function repositions force field.
Moves force field to world position x,y,z (updates center point of effect area). Takes handle (force field handle from b3dCreateForceField), x/y/z (new position in world space where force field is centered). Returns nothing. Sets ff.position, updates force field center for next physics update. Use to move force fields dynamically, reposition hazards, or animate force field locations.
This function repositions force field. Force field position: force field center point (origin of radial or directional force), sphere fields radiate from position (force emanates outward or inward from x/y/z point), cone fields extend from position (cone base at x/y/z, extends forward along rotation direction), position is world space coordinate (absolute position, same coordinate system as entities). Position parameters: x = horizontal east-west position (world X coordinate, positive east), y = vertical up-down position (world Y coordinate, positive up), z = horizontal north-south position (world Z coordinate, positive north/forward), position defines force field center (force calculations relative to this point). Use cases: (1) Moving hazards (force fields that patrol or follow paths), (2) Attached to entities (force field follows moving platform or enemy), (3) Dynamic gameplay (force fields appear, move, disappear based on triggers), (4) Animated effects (force fields that orbit, oscillate, or follow patterns), (5) Following character (force field centered on player for powerup effect). Common patterns: attach to entity b3dPositionForceField(field, b3dEntityX(entity), b3dEntityY(entity), b3dEntityZ(entity)), moving hazard b3dPositionForceField(field, patrolX, patrolY, patrolZ) each frame, orbiting field b3dPositionForceField(field, centerX + cos(time)*radius, centerY, centerZ + sin(time)*radius). Typical usage: call every frame for moving fields (update position based on path or entity), call on trigger events (reposition field when activated or state changes), call for dynamic effects (animate field movement over time).
Moving hazard example: patrol path points (pathPoints = array of positions for patrol route), update position each frame (currentPos = pathPoints[pathIndex], b3dPositionForceField(hazardField, currentPos.X, currentPos.Y, currentPos.Z)), advance path (pathIndex increments over time, wraps around at end), creates moving danger zone. Entity attachment example: force field follows entity (entity = movingPlatformEntity, get entity position each frame), update field position (entityX = b3dEntityX(entity), entityY = b3dEntityY(entity), entityZ = b3dEntityZ(entity)), position field at entity (b3dPositionForceField(attachedField, entityX, entityY, entityZ)), field moves with entity. Orbiting field example: orbit around center point (centerX/Y/Z fixed, radius and time variable), calculate orbit position (orbitX = centerX + cos(time * speed) * radius, orbitZ = centerZ + sin(time * speed) * radius), position field in orbit (b3dPositionForceField(orbitingField, orbitX, centerY, orbitZ)), creates circular moving force field. Oscillating field example: oscillate vertically (oscillateY = baseY + sin(time * frequency) * amplitude), fixed X and Z (fieldX and fieldZ constant, only Y changes), position field vertically (b3dPositionForceField(oscillateField, fieldX, oscillateY, fieldZ)), bobbing up and down effect. Player-centered field example: powerup force field follows player (playerEntity from player character), get player position (playerX/Y/Z from b3dEntityX/Y/Z(playerEntity)), position field at player (b3dPositionForceField(powerupField, playerX, playerY, playerZ)), creates aura effect. Dynamic activation: trigger activates field (If triggerActivated Then activateField = True), position field at trigger location (triggerPos = GetTriggerPosition(), b3dPositionForceField(activatedField, triggerPos.X, triggerPos.Y, triggerPos.Z)), field appears at specific location (spawn point or trigger zone). Position animation: interpolate between positions (currentPos = Lerp(startPos, endPos, t)), update field position (b3dPositionForceField(animField, currentPos.X, currentPos.Y, currentPos.Z)), smooth movement (t from 0 to 1 over time, smooth transition between points). Field effect radius: position determines center (radius extends from new position, effect area moves with position), characters in new radius affected (force applied based on distance from new position), characters outside new radius unaffected (no force if out of range from new center). Multiple position updates: can call every frame (continuous repositioning, smooth movement), can call sporadically (occasional repositioning, teleport effect), can call once (static repositioning, permanent new location). Coordinate system: x horizontal east-west (positive east, negative west), y vertical up-down (positive up, negative down), z horizontal north-south (positive north/forward, negative south/backward), position in world space (absolute coordinates, matches entity system). Position vs rotation: this sets position only (where force field is located, center point), rotation sets direction only (b3dRotateForceField for cone orientation, doesn't affect position), independent properties (can change position without affecting rotation). Position validation: no validation on position (any coordinates allowed, force field can be anywhere in world), position can be extreme (very large or negative coordinates, force field off-map is valid), position can be inside geometry (force field inside walls or floors, may affect characters unexpectedly). Force field persistence: position change immediate (takes effect next physics update, no delay), position remains until changed again (persistent, doesn't reset automatically), force field at new position until explicitly moved or deleted. Real-time positioning: safe to call every frame (O(1) operation, simple assignment), typical for moving hazards or attached fields (dynamic positioning, continuous updates), smooth movement (small position changes each frame create continuous motion). Performance: O(1) operation (simple vector assignment, instant), no computation required (position stored for later use during physics), safe to call every frame for moving fields (negligible cost). Validation: silently returns if handle not found (invalid or deleted force field, no error), no position validation (any values allowed, user responsible for reasonable coordinates), no error messages (silent failure for performance). Related: b3dCreateForceField creates force field (returns handle, initial position set at creation), b3dRotateForceField orients force field (sets direction for cone type, complementary to position), b3dScaleForceField resizes force field (changes radius, complementary to position), b3dDeleteForceField removes force field (cleanup when no longer needed).