@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); final InputCapsule cap = capsule; _wanderRadius = cap.readDouble("wanderRadius", DEFAULT_RADIUS); _wanderDistance = cap.readDouble("wanderDistance", DEFAULT_DISTANCE); _wanderJitter = cap.readDouble("wanderJitter", DEFAULT_JITTER); }
@Override public void write(final OutputCapsule capsule) throws IOException { super.write(capsule); final OutputCapsule cap = capsule; cap.write(_wanderRadius, "wanderRadius", DEFAULT_RADIUS); cap.write(_wanderDistance, "wanderDistance", DEFAULT_DISTANCE); cap.write(_wanderJitter, "wanderJitter", DEFAULT_JITTER); }
@Override public void read(final Ardor3DImporter e) throws IOException { super.read(e); final InputCapsule cap = e.getCapsule(this); _swarmRangeSQ = cap.readDouble("swarmRangeSQ", DEFAULT_SWARM_RANGE_SQ); _deviance = cap.readDouble("deviance", DEFAULT_DEVIANCE); _turnSpeed = cap.readDouble("turnSpeed", DEFAULT_TURN_SPEED); _speedBump = cap.readDouble("speedBump", DEFAULT_SPEED_BUMP); _maxSpeed = cap.readDouble("maxSpeed", DEFAULT_MAX_SPEED); _swarmOffset.set((Vector3) cap.readSavable("swarmOffset", new Vector3())); }
@Override public void write(final Ardor3DExporter e) throws IOException { super.write(e); final OutputCapsule cap = e.getCapsule(this); cap.write(_swarmRangeSQ, "swarmRangeSQ", DEFAULT_SWARM_RANGE_SQ); cap.write(_deviance, "deviance", DEFAULT_DEVIANCE); cap.write(_turnSpeed, "turnSpeed", DEFAULT_TURN_SPEED); cap.write(_speedBump, "speedBump", DEFAULT_SPEED_BUMP); cap.write(_maxSpeed, "maxSpeed", DEFAULT_MAX_SPEED); cap.write(_swarmOffset, "swarmOffset", new Vector3()); }
@Override public void prepare(final ParticleSystem system) { super.prepare(system); _swarmPoint.set(system.getOriginCenter()).addLocal(_swarmOffset); }