Small adjustments and polish

cut up light bridge to better z sort
This commit is contained in:
James Lambert 2023-12-04 22:13:51 -07:00
parent d29477c844
commit e79b2994d2
8 changed files with 11 additions and 3 deletions

View file

@ -122,7 +122,7 @@ struct DecorObjectDefinition gDecorObjectDefinitions[] = {
NULL,
},
0.0f,
1.0f,
1.3f,
PROPS_LIGHT_RAIL_ENDCAP_DYNAMIC_MODEL,
.materialIndex = LIGHT_RAIL_ENDCAP_INDEX,
.soundClipId = -1,

View file

@ -65,14 +65,16 @@ void staticRenderPopulateRooms(struct FrustrumCullingInformation* cullingInfo, M
struct RotatedBox rotatedBox;
rotatedBoxTransform(&staticTransforms[staticElement->transformIndex], animatedBox, &rotatedBox);
struct Transform* transform = &staticTransforms[staticElement->transformIndex];
rotatedBoxTransform(transform, animatedBox, &rotatedBox);
if (isRotatedBoxOutsideFrustrum(cullingInfo, &rotatedBox)) {
continue;
}
struct Vector3 center;
vector3Scale(&rotatedBox.origin, &center, 1.0f / SCENE_SCALE);
vector3AddScaled(&staticElement->center, &transform->position, 1.0f / SCENE_SCALE, &center);
renderSceneAdd(
renderScene,

View file

@ -525,5 +525,6 @@ void sceneDeserialize(struct Serializer* serializer, struct Scene* scene) {
if (scene->player.flags & (PlayerHasFirstPortalGun | PlayerHasSecondPortalGun)) {
scene->portalGun.portalGunVisible = 1;
scene->portalGun.rotation = scene->player.lookTransform.rotation;
}
}

View file

@ -216,4 +216,6 @@ void fizzlerUpdate(struct Fizzler* fizzler) {
fizzler->oldestParticleIndex = 0;
}
}
osWritebackDCache(fizzler->modelVertices, sizeof(Vtx) * maxVertex);
}

View file

@ -49,6 +49,9 @@ void portalGunInit(struct PortalGun* portalGun, struct Transform* at, int isFres
if (isFreshStart) {
skAnimatorRunClip(&portalGun->animator, &portal_gun_v_portalgun_Armature_draw_clip, 0.0f, 0);
// the first time the scene renders, the animation clip hasn't started yet
// this just hides the gun offscreen so it doesn't show up for a single frame
portalGun->armature.pose[0].position.y = -1.0f;
} else {
skAnimatorRunClip(&portalGun->animator, &portal_gun_v_portalgun_Armature_idle_clip, 0.0f, 0);
}