mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-03 06:01:27 +00:00
Add forceRoll field to first person camera
This commit is contained in:
parent
22ac33d3f3
commit
0481de1222
5 changed files with 14 additions and 6 deletions
|
@ -593,6 +593,7 @@
|
||||||
--- @class FirstPersonCamera
|
--- @class FirstPersonCamera
|
||||||
--- @field public crouch number
|
--- @field public crouch number
|
||||||
--- @field public enabled boolean
|
--- @field public enabled boolean
|
||||||
|
--- @field public forceRoll boolean
|
||||||
--- @field public fov number
|
--- @field public fov number
|
||||||
--- @field public pitch integer
|
--- @field public pitch integer
|
||||||
--- @field public yaw integer
|
--- @field public yaw integer
|
||||||
|
|
|
@ -848,6 +848,7 @@
|
||||||
| ----- | ---- | ------ |
|
| ----- | ---- | ------ |
|
||||||
| crouch | `number` | |
|
| crouch | `number` | |
|
||||||
| enabled | `boolean` | read-only |
|
| enabled | `boolean` | read-only |
|
||||||
|
| forceRoll | `boolean` | |
|
||||||
| fov | `number` | |
|
| fov | `number` | |
|
||||||
| pitch | `integer` | |
|
| pitch | `integer` | |
|
||||||
| yaw | `integer` | |
|
| yaw | `integer` | |
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
struct FirstPersonCamera gFirstPersonCamera = {
|
struct FirstPersonCamera gFirstPersonCamera = {
|
||||||
.enabled = false,
|
.enabled = false,
|
||||||
|
.forceRoll = true,
|
||||||
.pitch = 0,
|
.pitch = 0,
|
||||||
.yaw = 0,
|
.yaw = 0,
|
||||||
.crouch = 0,
|
.crouch = 0,
|
||||||
|
@ -131,6 +132,9 @@ void first_person_camera_update(void) {
|
||||||
vec3f_copy(gLakituState.goalFocus, gLakituState.focus);
|
vec3f_copy(gLakituState.goalFocus, gLakituState.focus);
|
||||||
|
|
||||||
// set other values
|
// set other values
|
||||||
|
if (gFirstPersonCamera.forceRoll) {
|
||||||
|
gLakituState.roll = 0;
|
||||||
|
}
|
||||||
gLakituState.posHSpeed = 0;
|
gLakituState.posHSpeed = 0;
|
||||||
gLakituState.posVSpeed = 0;
|
gLakituState.posVSpeed = 0;
|
||||||
gLakituState.focHSpeed = 0;
|
gLakituState.focHSpeed = 0;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
struct FirstPersonCamera {
|
struct FirstPersonCamera {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
|
bool forceRoll;
|
||||||
s16 pitch;
|
s16 pitch;
|
||||||
s16 yaw;
|
s16 yaw;
|
||||||
f32 crouch;
|
f32 crouch;
|
||||||
|
|
|
@ -674,13 +674,14 @@ static struct LuaObjectField sDjuiColorFields[LUA_DJUI_COLOR_FIELD_COUNT] = {
|
||||||
{ "r", LVT_U8, offsetof(struct DjuiColor, r), false, LOT_NONE },
|
{ "r", LVT_U8, offsetof(struct DjuiColor, r), false, LOT_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LUA_FIRST_PERSON_CAMERA_FIELD_COUNT 5
|
#define LUA_FIRST_PERSON_CAMERA_FIELD_COUNT 6
|
||||||
static struct LuaObjectField sFirstPersonCameraFields[LUA_FIRST_PERSON_CAMERA_FIELD_COUNT] = {
|
static struct LuaObjectField sFirstPersonCameraFields[LUA_FIRST_PERSON_CAMERA_FIELD_COUNT] = {
|
||||||
{ "crouch", LVT_F32, offsetof(struct FirstPersonCamera, crouch), false, LOT_NONE },
|
{ "crouch", LVT_F32, offsetof(struct FirstPersonCamera, crouch), false, LOT_NONE },
|
||||||
{ "enabled", LVT_BOOL, offsetof(struct FirstPersonCamera, enabled), true, LOT_NONE },
|
{ "enabled", LVT_BOOL, offsetof(struct FirstPersonCamera, enabled), true, LOT_NONE },
|
||||||
{ "fov", LVT_F32, offsetof(struct FirstPersonCamera, fov), false, LOT_NONE },
|
{ "forceRoll", LVT_BOOL, offsetof(struct FirstPersonCamera, forceRoll), false, LOT_NONE },
|
||||||
{ "pitch", LVT_S16, offsetof(struct FirstPersonCamera, pitch), false, LOT_NONE },
|
{ "fov", LVT_F32, offsetof(struct FirstPersonCamera, fov), false, LOT_NONE },
|
||||||
{ "yaw", LVT_S16, offsetof(struct FirstPersonCamera, yaw), false, LOT_NONE },
|
{ "pitch", LVT_S16, offsetof(struct FirstPersonCamera, pitch), false, LOT_NONE },
|
||||||
|
{ "yaw", LVT_S16, offsetof(struct FirstPersonCamera, yaw), false, LOT_NONE },
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LUA_FLOOR_GEOMETRY_FIELD_COUNT 4
|
#define LUA_FLOOR_GEOMETRY_FIELD_COUNT 4
|
||||||
|
|
Loading…
Reference in a new issue