mirror of
https://github.com/mwpenny/portal64-still-alive.git
synced 2024-10-20 10:37:37 -04:00
Work on test chamber 4 triggers
This commit is contained in:
parent
8938c24ae7
commit
90f775c43f
1
assets/sound/vo/aperture_ai/04_part1_entry-1.sox
Normal file
1
assets/sound/vo/aperture_ai/04_part1_entry-1.sox
Normal file
|
@ -0,0 +1 @@
|
|||
-c 1 -r 22050
|
1
assets/sound/vo/aperture_ai/04_part1_success-1.sox
Normal file
1
assets/sound/vo/aperture_ai/04_part1_success-1.sox
Normal file
|
@ -0,0 +1 @@
|
|||
-c 1 -r 22050
|
Binary file not shown.
|
@ -212,6 +212,7 @@ struct BallLauncherDefinition {
|
|||
struct Quaternion rotation;
|
||||
short roomIndex;
|
||||
short signalIndex;
|
||||
float ballLifetime;
|
||||
};
|
||||
|
||||
struct BallCatcherDefinition {
|
||||
|
|
|
@ -45,7 +45,7 @@ void ballInitInactive(struct Ball* ball) {
|
|||
ball->flags = 0;
|
||||
}
|
||||
|
||||
void ballInit(struct Ball* ball, struct Vector3* position, struct Vector3* velocity, short startingRoom) {
|
||||
void ballInit(struct Ball* ball, struct Vector3* position, struct Vector3* velocity, short startingRoom, float ballLifetime) {
|
||||
collisionObjectInit(&ball->collisionObject, &gBallCollider, &ball->rigidBody, 1.0f, 0);
|
||||
|
||||
collisionSceneAddDynamicObject(&ball->collisionObject);
|
||||
|
@ -58,7 +58,6 @@ void ballInit(struct Ball* ball, struct Vector3* position, struct Vector3* veloc
|
|||
ball->rigidBody.transform.scale = gOneVec;
|
||||
ball->rigidBody.currentRoom = startingRoom;
|
||||
ball->flags = 0;
|
||||
ball->lifetime = BALL_LIFETIME;
|
||||
|
||||
ball->targetSpeed = sqrtf(vector3MagSqrd(&ball->rigidBody.velocity));
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "../physics/collision_object.h"
|
||||
|
||||
#define BALL_VELOCITY 2.0f
|
||||
#define BALL_LIFETIME 10.0f
|
||||
#define BALL_FADE_TIME 3.0f
|
||||
|
||||
enum BallFlags {
|
||||
|
@ -22,7 +21,7 @@ struct Ball {
|
|||
};
|
||||
|
||||
void ballInitInactive(struct Ball* ball);
|
||||
void ballInit(struct Ball* ball, struct Vector3* position, struct Vector3* velocity, short startingRoom);
|
||||
void ballInit(struct Ball* ball, struct Vector3* position, struct Vector3* velocity, short startingRoom, float ballLifetime);
|
||||
void ballTurnOnCollision(struct Ball* ball);
|
||||
|
||||
void ballUpdate(struct Ball* ball);
|
||||
|
|
|
@ -62,6 +62,7 @@ void ballLauncherInit(struct BallLauncher* launcher, struct BallLauncherDefiniti
|
|||
launcher->rigidBody.currentRoom = definition->roomIndex;
|
||||
|
||||
launcher->signalIndex = definition->signalIndex;
|
||||
launcher->ballLifetime = definition->ballLifetime;
|
||||
|
||||
collisionObjectUpdateBB(&launcher->collisionObject);
|
||||
|
||||
|
@ -89,7 +90,7 @@ void ballLauncherUpdate(struct BallLauncher* launcher) {
|
|||
quatMultVector(&launcher->rigidBody.transform.rotation, &gForward, &initialVelocity);
|
||||
vector3Scale(&initialVelocity, &initialVelocity, BALL_VELOCITY);
|
||||
|
||||
ballInit(&launcher->currentBall, &launcher->rigidBody.transform.position, &initialVelocity, launcher->rigidBody.currentRoom);
|
||||
ballInit(&launcher->currentBall, &launcher->rigidBody.transform.position, &initialVelocity, launcher->rigidBody.currentRoom, launcher->ballLifetime);
|
||||
skAnimatorRunClip(&launcher->animator, &props_combine_ball_launcher_Armature_launch_clip, 0.0f, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ struct BallLauncher {
|
|||
struct SKAnimator animator;
|
||||
short dynamicId;
|
||||
short signalIndex;
|
||||
float ballLifetime;
|
||||
struct Ball currentBall;
|
||||
};
|
||||
|
||||
|
|
|
@ -270,6 +270,24 @@ local room_grids = {}
|
|||
for index, node in pairs(collider_nodes) do
|
||||
local is_transparent = sk_scene.find_flag_argument(node.arguments, "transparent")
|
||||
|
||||
local collision_layers = {}
|
||||
|
||||
for _, arg in pairs(node.arguments) do
|
||||
if string.sub(arg, 1, #"CL_") == "CL_" then
|
||||
table.insert(collision_layers, 'COLLISION_LAYERS_' .. string.sub(arg, #"CL_" + 1))
|
||||
end
|
||||
end
|
||||
|
||||
if #collision_layers == 0 then
|
||||
table.insert(collision_layers, 'COLLISION_LAYERS_STATIC')
|
||||
table.insert(collision_layers, 'COLLISION_LAYERS_BLOCK_BALL')
|
||||
table.insert(collision_layers, 'COLLISION_LAYERS_TANGIBLE')
|
||||
|
||||
if is_transparent then
|
||||
table.insert(collision_layers, 'COLLISION_LAYERS_TRANSPARENT')
|
||||
end
|
||||
end
|
||||
|
||||
for _, mesh in pairs(node.node.meshes) do
|
||||
local global_mesh = mesh:transform(node.node.full_transformation)
|
||||
|
||||
|
@ -306,9 +324,7 @@ for index, node in pairs(collider_nodes) do
|
|||
sk_definition_writer.reference_to(collider_type),
|
||||
sk_definition_writer.null_value,
|
||||
bb,
|
||||
is_transparent and
|
||||
sk_definition_writer.raw('COLLISION_LAYERS_STATIC | COLLISION_LAYERS_BLOCK_BALL | COLLISION_LAYERS_TRANSPARENT | COLLISION_LAYERS_TANGIBLE') or
|
||||
sk_definition_writer.raw('COLLISION_LAYERS_STATIC | COLLISION_LAYERS_BLOCK_BALL | COLLISION_LAYERS_TANGIBLE')
|
||||
sk_definition_writer.raw(table.concat(collision_layers, ' | '))
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
|
@ -186,6 +186,7 @@ for _, switch_element in pairs(sk_scene.nodes_for_type('@ball_launcher')) do
|
|||
rotation * sk_math.axis_angle(sk_math.vector3(1, 0, 0), math.pi * 0.5),
|
||||
room_index,
|
||||
signals.signal_index_for_name(switch_element.arguments[1]),
|
||||
switch_element.arguments[2] and tonumber(switch_element.arguments[2]) or 10
|
||||
})
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue