diff --git a/source/core/actorlist.cpp b/source/core/actorlist.cpp index 43f5e58a2..539564fd2 100644 --- a/source/core/actorlist.cpp +++ b/source/core/actorlist.cpp @@ -549,6 +549,7 @@ DEFINE_FIELD_NAMED(DCoreActor, sprext.alpha, alpha) DEFINE_FIELD_NAMED(DCoreActor, time, spawnindex) DEFINE_FIELD_NAMED(DCoreActor, spritesetindex, spritesetpic) DEFINE_FIELD_NAMED(DCoreActor, spr.angle, angle) +DEFINE_FIELD(DCoreActor, vel) void coreactor_setpos(DCoreActor* self, double x, double y, double z, int relink) { @@ -633,3 +634,34 @@ DEFINE_ACTION_FUNCTION_NATIVE(DCoreActor, backuppos, coreactor_backuppos) return 0; } +void coreactor_setposition(DCoreActor* self, double x, double y, double z) +{ + SetActor(self, DVector3(x, y, z)); +} + +DEFINE_ACTION_FUNCTION_NATIVE(DCoreActor, setposition, coreactor_setposition) +{ + PARAM_SELF_PROLOGUE(DCoreActor); + PARAM_FLOAT(x); + PARAM_FLOAT(y); + PARAM_FLOAT(z); + coreactor_setposition(self, x, y, z); + return 0; +} + +void coreactor_setpositionz(DCoreActor* self, double x, double y, double z) +{ + SetActorZ(self, DVector3(x, y, z)); +} + +DEFINE_ACTION_FUNCTION_NATIVE(DCoreActor, setpositionz, coreactor_setpositionz) +{ + PARAM_SELF_PROLOGUE(DCoreActor); + PARAM_FLOAT(x); + PARAM_FLOAT(y); + PARAM_FLOAT(z); + coreactor_setpositionz(self, x, y, z); + return 0; +} + + diff --git a/wadsrc/static/zscript/coreactor.zs b/wadsrc/static/zscript/coreactor.zs index 1106ba0aa..37fcaf667 100644 --- a/wadsrc/static/zscript/coreactor.zs +++ b/wadsrc/static/zscript/coreactor.zs @@ -1,4 +1,10 @@ +enum EClipMask +{ + CLIPMASK0 = (1 << 16) + 1, + CLIPMASK1 = (256 << 16) + 64 +}; + class CoreActor native { native readonly sectortype sectp; @@ -32,6 +38,7 @@ class CoreActor native native float alpha; native double clipdist; native double angle; + native Vector3 vel; native readonly int16 spritesetpic; native readonly int spawnindex; @@ -41,5 +48,7 @@ class CoreActor native native void move(Vector3 newpos, bool relink = true); native void setSpritePic(int index); // index into actor's spriteset. native void backuppos(); + native void setPosition(Vector3 pos); + native void setPositionZ(Vector3 pos); }