arx-level-generator
Version:
A tool for creating Arx Fatalis maps
78 lines • 2.32 kB
JavaScript
import { Color } from './Color.js';
import { Rotation } from './Rotation.js';
import { Vector3 } from './Vector3.js';
export class Fog {
position;
orientation;
color;
size;
special;
scale;
movement;
speed;
rotateSpeed;
toLive;
frequency;
constructor(props) {
this.position = props.position;
this.orientation = props.orientation;
this.color = props.color;
this.size = props.size;
this.special = props.special;
this.scale = props.scale;
this.movement = props.movement;
this.speed = props.speed;
this.rotateSpeed = props.rotateSpeed;
this.toLive = props.toLive;
this.frequency = props.frequency;
}
clone() {
return new Fog({
position: this.position.clone(),
orientation: this.orientation.clone(),
color: this.color.clone(),
size: this.size,
special: this.special,
scale: this.scale,
movement: this.movement.clone(),
speed: this.speed,
rotateSpeed: this.rotateSpeed,
toLive: this.toLive,
frequency: this.frequency,
});
}
static fromArxFog(fog) {
return new Fog({
position: Vector3.fromArxVector3(fog.pos),
orientation: Rotation.fromArxRotation(fog.angle),
color: Color.fromArxColor(fog.color),
size: fog.size,
special: fog.special,
scale: fog.scale,
movement: Vector3.fromArxVector3(fog.move),
speed: fog.speed,
rotateSpeed: fog.rotateSpeed,
toLive: fog.toLive,
frequency: fog.frequency,
});
}
toArxFog() {
return {
pos: this.position.toArxVector3(),
angle: this.orientation.toArxRotation(),
color: this.color.toArxColor(),
size: this.size,
special: this.special,
scale: this.scale,
move: this.movement.toArxVector3(),
speed: this.speed,
rotateSpeed: this.rotateSpeed,
toLive: this.toLive,
frequency: this.frequency,
};
}
move(offset) {
this.position.add(offset);
}
}
//# sourceMappingURL=Fog.js.map