MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / PhysicsComp_Init

Function PhysicsComp_Init

src/EntityComponents.c:711–722  ·  view source on GitHub ↗

#######################################################################################################################* *----------------------------------------------------PhysicsComponent-----------------------------------------------------* *#########################################################################################################################*/

Source from the content-addressed store, hash-verified

709*----------------------------------------------------PhysicsComponent-----------------------------------------------------*
710*#########################################################################################################################*/
711void PhysicsComp_Init(struct PhysicsComp* comp, struct Entity* entity) {
712 Mem_Set(comp, 0, sizeof(struct PhysicsComp));
713 comp->CanLiquidJump = true;
714 comp->Entity = entity;
715 comp->JumpVel = 0.42f;
716 comp->UserJumpVel = 0.42f;
717 comp->ServerJumpVel = 0.42f;
718
719 comp->gravity = 0.08f;
720 Vec3_Set(comp->drag, 0.91f, 0.98f, 0.91f);
721 Vec3_Set(comp->groundFriction, 0.6f, 1.0f, 0.6f);
722}
723
724static cc_bool PhysicsComp_TouchesLiquid(BlockID block) { return Blocks.Collide[block] == COLLIDE_LIQUID; }
725void PhysicsComp_UpdateVelocityState(struct PhysicsComp* comp) {

Callers 1

LocalPlayer_InitFunction · 0.85

Calls 1

Mem_SetFunction · 0.85

Tested by

no test coverage detected