mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-23 14:47:28 +08:00
Type initialization using objects
This commit is contained in:
@@ -3,9 +3,19 @@ import IEntity from "./IEntity"
|
||||
export default class RotatorEntity extends IEntity {
|
||||
|
||||
static attributes = {
|
||||
R: Number,
|
||||
P: Number,
|
||||
Y: Number,
|
||||
R: {
|
||||
value: 0,
|
||||
},
|
||||
P: {
|
||||
value: 0,
|
||||
},
|
||||
Y: {
|
||||
value: 0,
|
||||
},
|
||||
}
|
||||
|
||||
static {
|
||||
this.cleanupAttributes(this.attributes)
|
||||
}
|
||||
|
||||
constructor(values) {
|
||||
@@ -14,4 +24,16 @@ export default class RotatorEntity extends IEntity {
|
||||
/** @type {Number} */ this.P
|
||||
/** @type {Number} */ this.Y
|
||||
}
|
||||
|
||||
getRoll() {
|
||||
return this.R
|
||||
}
|
||||
|
||||
getPitch() {
|
||||
return this.P
|
||||
}
|
||||
|
||||
getYaw() {
|
||||
return this.Y
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user