MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / SetEntityPhysicParams

Method SetEntityPhysicParams

CrySystem/ScriptObjectEntity.cpp:1641–2003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1639
1640
1641int CScriptObjectEntity::SetEntityPhysicParams(IPhysicalEntity *pe, IFunctionHandler *pH,int iOffs, ICryCharInstance *pIChar)
1642{
1643 int nType;
1644 pH->GetParam(1+iOffs, nType);
1645 CScriptObjectVector vec(m_pScriptSystem,true);
1646 _SmartScriptObject pTable(m_pScriptSystem,true);
1647 _SmartScriptObject pTempObj(m_pScriptSystem,true);
1648 pH->GetParam(2+iOffs, *pTable);
1649 int nId;
1650 pe_params_particle particle_params;
1651 pe_simulation_params sim_params;
1652 pe_params_car vehicle_params;
1653 pe_params_wheel wheel_params;
1654 pe_player_dynamics playerdyn_params;
1655 pe_player_dimensions playerdim_params;
1656 pe_params_articulated_body artic_params;
1657 pe_params_joint joint_params;
1658 pe_params_rope rope_params,rope_params1;
1659 pe_params_softbody soft_params;
1660 pe_params_buoyancy buoy_params;
1661 pe_action_add_constraint constr_params;
1662 pe_action_remove_constraint remove_constr_params;
1663 pe_params_flags flags_params;
1664 pe_action_set_velocity asv;
1665 pe_params_part pp;
1666 const char *strName;
1667 int idEnt;
1668 IEntity *pEnt;
1669 ICryBone *pBone;
1670 float gears[8];
1671 //float fDummy;
1672 vectorf gravity(zero); float fSpeed;
1673
1674 switch (nType)
1675 {
1676 case PHYSICPARAM_FLAGS:
1677 if (pTable->GetValue("flags_mask", (int&)flags_params.flagsAND))
1678 {
1679 flags_params.flagsAND = ~flags_params.flagsAND;
1680 pTable->GetValue("flags", (int&)flags_params.flagsOR);
1681 }
1682 else
1683 pTable->GetValue("flags", (int&)flags_params.flags);
1684 pe->SetParams(&flags_params);
1685 break;
1686 case PHYSICPARAM_PART_FLAGS:
1687 if (pTable->GetValue("flags_mask", (int&)pp.flagsAND))
1688 pp.flagsAND = ~pp.flagsAND;
1689 pTable->GetValue("flags", (int&)pp.flagsOR);
1690 if (pTable->GetValue("flags_collider_mask", (int&)pp.flagsColliderAND))
1691 pp.flagsColliderAND = ~pp.flagsColliderAND;
1692 pTable->GetValue("flags_collider", (int&)pp.flagsColliderOR);
1693 if (!pTable->GetValue("partid",pp.partid))
1694 pp.ipart = 0;
1695 do {
1696 if (!pe->SetParams(&pp))
1697 break;
1698 pp.ipart++;

Callers

nothing calls this directly

Calls 14

is_unusedFunction · 0.85
GetLengthSquaredMethod · 0.80
EndFunctionMethod · 0.80
GetParamMethod · 0.45
GetValueMethod · 0.45
SetParamsMethod · 0.45
GetMethod · 0.45
GetEntityMethod · 0.45
GetPhysicsMethod · 0.45
GetAtMethod · 0.45
SetMethod · 0.45
ActionMethod · 0.45

Tested by

no test coverage detected