@chronodivide/game-api 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/index.d.ts +62 -4
- package/dist/index.js +1 -1
- package/dist/res/ra2cd.mix +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Euler as Euler_2 } from 'three';
|
|
2
|
+
import { Quaternion as Quaternion_2 } from 'three';
|
|
3
|
+
|
|
1
4
|
export declare class ActionsApi {
|
|
2
5
|
#private;
|
|
3
6
|
placeBuilding(buildingName: string, rx: number, ry: number): void;
|
|
@@ -219,10 +222,25 @@ export declare class CrewRules {
|
|
|
219
222
|
readIni(ini: IniSection): this;
|
|
220
223
|
}
|
|
221
224
|
|
|
225
|
+
export declare class Cylindrical extends THREE.Cylindrical {
|
|
226
|
+
setFromVector3(vec3: Vector3): this;
|
|
227
|
+
}
|
|
228
|
+
|
|
222
229
|
export declare class DMislRules extends MissileRules {
|
|
223
230
|
readIni(ini: IniSection): this;
|
|
224
231
|
}
|
|
225
232
|
|
|
233
|
+
export declare class Euler extends THREE.Euler {
|
|
234
|
+
isEuler: true;
|
|
235
|
+
private _x;
|
|
236
|
+
private _y;
|
|
237
|
+
private _z;
|
|
238
|
+
private _order;
|
|
239
|
+
setFromRotationMatrix(m: Matrix4, order?: string, update?: boolean): this;
|
|
240
|
+
reorder(newOrder: string): Euler_2;
|
|
241
|
+
toVector3(optionalResult?: Vector3): Vector3;
|
|
242
|
+
}
|
|
243
|
+
|
|
226
244
|
export declare interface FactoryData {
|
|
227
245
|
status: FactoryStatus;
|
|
228
246
|
/** The unit currently being delivered by the factory, if its status is {@link FactoryStatus.Delivering} */
|
|
@@ -310,7 +328,7 @@ export declare interface GameObjectData {
|
|
|
310
328
|
/** What tile the object is currently on. If the object occupies more than one tile, this is the top-most tile */
|
|
311
329
|
tile: Tile;
|
|
312
330
|
/** The object position in world space */
|
|
313
|
-
worldPosition:
|
|
331
|
+
worldPosition: Vector3;
|
|
314
332
|
/** The object elevation above the ground, in Z levels */
|
|
315
333
|
tileElevation: number;
|
|
316
334
|
/** The size in tiles occupied by this object */
|
|
@@ -549,6 +567,18 @@ export declare class MapApi {
|
|
|
549
567
|
getAllTilesResourceData(): TileResourceData[];
|
|
550
568
|
}
|
|
551
569
|
|
|
570
|
+
export declare class Matrix4 extends THREE.Matrix4 {
|
|
571
|
+
extractRotation(m: Matrix4): this;
|
|
572
|
+
makeRotationFromEuler(euler: Euler): this;
|
|
573
|
+
lookAt(eye: Vector3, target: Vector3, up: Vector3): this;
|
|
574
|
+
getMaxScaleOnAxis(): number;
|
|
575
|
+
makeRotationX(theta: number): this;
|
|
576
|
+
makeRotationY(theta: number): this;
|
|
577
|
+
makeRotationZ(theta: number): this;
|
|
578
|
+
makeRotationAxis(axis: Vector3, angle: number): this;
|
|
579
|
+
decompose(position: Vector3, quaternion: Quaternion, scale: Vector3): Object[];
|
|
580
|
+
}
|
|
581
|
+
|
|
552
582
|
export declare class MissileRules {
|
|
553
583
|
/** How many frames the rocket pauses on the launcher before tilting */
|
|
554
584
|
pauseFrames: number;
|
|
@@ -883,6 +913,18 @@ export declare class PublicApi {
|
|
|
883
913
|
createGame(opts: CreateOpts): Promise<GameInstanceApi>;
|
|
884
914
|
}
|
|
885
915
|
|
|
916
|
+
export declare class Quaternion extends THREE.Quaternion {
|
|
917
|
+
private _x;
|
|
918
|
+
private _y;
|
|
919
|
+
private _z;
|
|
920
|
+
private _w;
|
|
921
|
+
setFromEuler(euler: Euler, update?: boolean): this;
|
|
922
|
+
setFromAxisAngle(axis: Vector3, angle: number): this;
|
|
923
|
+
setFromRotationMatrix(m: Matrix4): this;
|
|
924
|
+
length(): number;
|
|
925
|
+
slerp(qb: Quaternion, t: number): this | Quaternion_2;
|
|
926
|
+
}
|
|
927
|
+
|
|
886
928
|
export declare interface QueueData {
|
|
887
929
|
size: number;
|
|
888
930
|
maxSize: number;
|
|
@@ -1057,6 +1099,10 @@ export declare enum SpeedType {
|
|
|
1057
1099
|
Winged = 7
|
|
1058
1100
|
}
|
|
1059
1101
|
|
|
1102
|
+
export declare class Spherical extends THREE.Spherical {
|
|
1103
|
+
setFromVector3(vec3: Vector3): this;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1060
1106
|
export declare enum StanceType {
|
|
1061
1107
|
None = 0,
|
|
1062
1108
|
Guard = 1,
|
|
@@ -1412,7 +1458,7 @@ export declare class TechnoRules extends ObjectRules {
|
|
|
1412
1458
|
/** Only for aircraft */
|
|
1413
1459
|
pitchSpeed: number;
|
|
1414
1460
|
damageParticleSystems: string[];
|
|
1415
|
-
damageSmokeOffset:
|
|
1461
|
+
damageSmokeOffset: Vector3;
|
|
1416
1462
|
minDebris: number;
|
|
1417
1463
|
maxDebris: number;
|
|
1418
1464
|
/** Only for vehicles */
|
|
@@ -1421,7 +1467,7 @@ export declare class TechnoRules extends ObjectRules {
|
|
|
1421
1467
|
debrisAnims: string[];
|
|
1422
1468
|
/** Only for lamps */
|
|
1423
1469
|
isLightpost: boolean;
|
|
1424
|
-
/** Only for lamps */
|
|
1470
|
+
/** Only for lamps. Distance in leptons that the light emitted from this building is visible from */
|
|
1425
1471
|
lightVisibility: number;
|
|
1426
1472
|
/** Only for lamps */
|
|
1427
1473
|
lightIntensity: number;
|
|
@@ -1591,7 +1637,7 @@ export declare interface UnitData extends GameObjectData {
|
|
|
1591
1637
|
/** If the unit is not currently incapacitated and is able to move */
|
|
1592
1638
|
canMove?: boolean;
|
|
1593
1639
|
/** The current velocity vector in world space */
|
|
1594
|
-
velocity?:
|
|
1640
|
+
velocity?: Vector3;
|
|
1595
1641
|
/** Only applicable to infantry */
|
|
1596
1642
|
stance?: StanceType;
|
|
1597
1643
|
/** Only applicable to harvesters */
|
|
@@ -1612,6 +1658,18 @@ export declare class V3RocketRules extends MissileRules {
|
|
|
1612
1658
|
readIni(ini: IniSection): this;
|
|
1613
1659
|
}
|
|
1614
1660
|
|
|
1661
|
+
export declare class Vector3 extends THREE.Vector3 {
|
|
1662
|
+
applyEuler(euler: Euler): this;
|
|
1663
|
+
applyAxisAngle(axis: Vector3, angle: number): this;
|
|
1664
|
+
length(): number;
|
|
1665
|
+
projectOnPlane(planeNormal: Vector3): this;
|
|
1666
|
+
reflect(normal: Vector3): this;
|
|
1667
|
+
angleTo(v: Vector3): number;
|
|
1668
|
+
distanceTo(v: Vector3): number;
|
|
1669
|
+
setFromSpherical(s: Spherical): this;
|
|
1670
|
+
setFromCylindrical(c: Cylindrical): this;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1615
1673
|
export declare enum VeteranAbility {
|
|
1616
1674
|
FASTER = 0,
|
|
1617
1675
|
STRONGER = 1,
|