added keybind

This commit is contained in:
2026-03-06 16:42:16 +02:00
parent 9b4cec7920
commit 1a2a353e03
30 changed files with 338 additions and 53 deletions

View File

@@ -33,7 +33,7 @@ DECLARE_BUILD_STAGE(install_game)
filesystem2->CopyFile(szOutputDir, GET_PROJECT_OBJECT(rapier, "physics"));
}
if ( GET_PROJECT_VALUE(config, "steam") == "true" ) {
filesystem2->CopyFile(szOutputDir, EXTERNAL"steamworks/redistributable_bin/linux64/libsteam_api.so");
filesystem2->CopyFile(szOutputDir, GET_PROJECT_OBJECT(config, "steam_lib"));
}
filesystem2->CopyFile(szOutputDir, GET_PROJECT_OBJECT(launcher, "launcher"));
filesystem2->CopyDirectory(CUtlString("%s/core/",szOutputDir.GetString()), "funnyassets/models");

View File

@@ -1,6 +1,7 @@
#include "helper.h"
#include "tier0/commandline.h"
#define EXTERNAL "external/"
DECLARE_BUILD_STAGE(config)
{
if (Target_t::DefaultTarget().kernel == TARGET_KERNEL_IOS)
@@ -10,8 +11,20 @@ DECLARE_BUILD_STAGE(config)
}
else
{
if (Target_t::DefaultTarget().GetTriplet() == "x86_64-unknown-linux")
{
ADD_OUTPUT_VALUE("steam", "true");
ADD_OUTPUT_OBJECT("steam_lib", EXTERNAL"steamworks/redistributable_bin/linux64/libsteam_api.so");
}
else if (Target_t::DefaultTarget().kernel == TARGET_KERNEL_WINDOWS)
{
ADD_OUTPUT_VALUE("steam", "true");
ADD_OUTPUT_OBJECT("steam_lib", EXTERNAL"steamworks/redistributable_bin/win64/steam_api64.dll");
}
else {
ADD_OUTPUT_VALUE("steam", "false");
}
ADD_OUTPUT_VALUE("static", "false");
ADD_OUTPUT_VALUE("steam", "true");
}
ADD_OUTPUT_VALUE("static", "true");
return 0;

View File

@@ -47,14 +47,13 @@ DECLARE_BUILD_STAGE(engine)
}
else
{
if ( GET_PROJECT_VALUE(config, "steam") == "true" ) {
ldProject.libraryDirectories.AppendTail(EXTERNAL"steamworks/redistributable_bin/linux64");
ldProject.libraries.AppendTail("steam_api");
}
ldProject.linkType = ELINK_DYNAMIC_LIBRARY;
ldProject.libraryObjects = {
GET_PROJECT_LIBRARY(tier0, "tier0"),
};
if ( GET_PROJECT_VALUE(config, "steam") == "true" ) {
ldProject.libraryObjects.AppendTail(GET_PROJECT_OBJECT(config, "steam_lib"));
}
ldProject.objects.AppendTail({GET_PROJECT_LIBRARY(tier1, "tier1")});
ldProject.objects.AppendTail({GET_PROJECT_LIBRARY(tier2, "tier2")});
}
@@ -72,7 +71,6 @@ DECLARE_BUILD_STAGE(engine)
ldProject.libraries.AppendTail("version");
ldProject.libraries.AppendTail("shell32");
ldProject.libraries.AppendTail("uuid");
};
CUtlString outputProject = linker->Link(&ldProject);

View File

@@ -9,14 +9,8 @@ void CClientGameDLL::Init()
{
void *pLib;
#ifdef __linux
pLib = Plat_LoadLibrary("libclient.so");
#endif
if (!pLib)
Plat_FatalErrorFunc("Failed to load server library\n");
m_pLibrary = pLib;
CreateInterfaceFn pfnServerFactory = Sys_GetFactory(pLib);
CreateInterfaceFn pfnServerFactory = Sys_GetFactory("client");
IEngineBridge *pEngineBridge = (IEngineBridge*)pfnServerFactory(ENGINE_BRIDGE_INTERFACE_VERSION, NULL);
pEngineBridge->ConnectInterface(FILESYSTEM_INTERFACE_VERSION, filesystem);

View File

@@ -38,10 +38,20 @@ extern "C" void __cdecl SteamAPIDebug( ESteamNetworkingSocketsDebugOutputType nT
extern "C" void FunnyMain( int argc, char **argv )
{
#ifdef __WIN32__
CUtlString szPath = Plat_GetExecutablePath();
szPath = szPath.GetDirectory();
CUtlString szEnv = Plat_GetEnv("PATH");
szEnv.AppendTail(":");
szEnv.AppendTail(szPath);
Plat_SetEnv("PATH", szEnv);
#endif
CommandLine()->CreateCommandLine(argc, argv);
EngineConsts_t stConstants = {};
V_printf("------------ 1\n");
#ifdef STEAM
V_printf("Steam :)\n");
if(SteamAPI_RestartAppIfNecessary(480))
{
V_printf("Mshallah we are doing reboot\n");
@@ -51,6 +61,7 @@ extern "C" void FunnyMain( int argc, char **argv )
stConstants.m_bIsSteam = true;
if (!SteamAPI_Init())
{
V_printf("Steam :()\n");
stConstants.m_bIsSteam = false;
}
stConstants.LaunchServer = LaunchServerAtSteamRelay;

View File

View File

View File

@@ -16,6 +16,7 @@ DECLARE_BUILD_STAGE(Client)
compileProject.m_szName = "client";
compileProject.files = {
"../shared/game.cpp",
"../shared/boneanimation.cpp",
"game.cpp",
"userinput.cpp",
@@ -50,16 +51,23 @@ DECLARE_BUILD_STAGE(Client)
}
else
{
if ( GET_PROJECT_VALUE(config, "steam") == "true" ) {
ldProject.libraryDirectories.AppendTail(EXTERNAL"steamworks/redistributable_bin/linux64");
ldProject.libraries.AppendTail("steam_api");
}
ldProject.linkType = ELINK_DYNAMIC_LIBRARY;
ldProject.libraryObjects = {
GET_PROJECT_LIBRARY(tier0, "tier0"),
};
ldProject.objects.AppendTail({GET_PROJECT_LIBRARY(tier1, "tier1")});
ldProject.objects.AppendTail({GET_PROJECT_LIBRARY(tier2, "tier2")});
if ( GET_PROJECT_VALUE(config, "steam") == "true" ) {
ldProject.libraryObjects.AppendTail(GET_PROJECT_OBJECT(config, "steam_lib"));
}
if (ldProject.m_target.kernel & TARGET_KERNEL_WINDOWS_DEVICES)
{
ldProject.libraryDirectories.AppendTail(EXTERNAL"windows");
ldProject.libraries.AppendTail("winpthread-1");
ldProject.libraries.AppendTail("ws2_32");
}
}

View File

@@ -185,9 +185,6 @@ void CEntitySystem::NetRecvPacket( NetPacket_t *pPacket )
{
case MESSAGE_ENTITY_CLASS_SYNC:
V_printf("MESSAGE_ENTITY_CLASS_SYNC: %u = %s\n",
(uint32_t)pPlayerPacket->m_entityClass.m_uIndex,
pPlayerPacket->m_entityClass.m_szEntityName);
pEntity = CreateByClassnameWithIndex(
(char*)pPlayerPacket->m_entityClass.m_szEntityName,
pPlayerPacket->m_entityClass.m_uIndex
@@ -226,7 +223,6 @@ void CEntitySystem::NetRecvPacket( NetPacket_t *pPacket )
}
break;
case k_EMessage_PlayerSetLocalEntity:
V_printf("k_EMessage_PlayerSetLocalEntity: %u\n",(uint32_t)pPlayerPacket->m_setLocalEntity.m_uIndex);
if (pPlayerPacket->m_setLocalEntity.m_uIndex > MAX_EDICTS)
break;
s_pLocalEntity = m_pEntities[pPlayerPacket->m_setLocalEntity.m_uIndex];
@@ -235,9 +231,74 @@ void CEntitySystem::NetRecvPacket( NetPacket_t *pPacket )
}
}
void CEntitySystem::NetSendThink()
void CEntitySystem::NetSendThink( INetworkBase *pBase )
{
C_BaseEntity *pEntity;
int i;
uint32_t u;
uint32_t x;
uint32_t uSize;
netmap_t *pNetMap;
void *pData;
union {
void *pCurrentData;
char *pcCurrentData;
EntityDataSync_t *pSync;
EntityDataSyncValue_t *pValue;
};
pEntity = UTIL_GetLocalPlayer();
if ( pEntity == NULL )
return;
pNetMap = pEntity->GetSendMap();
uSize = sizeof(EntityDataSyncValue_t);
x = 0;
while ( pNetMap )
{
for ( u = 0; u < pNetMap->m_uFieldCount; u++ )
{
x++;
uSize += (pNetMap->m_pFields[u].m_uSize+7) & ~7;
uSize += sizeof(EntityDataSyncValue_t);
}
pNetMap = pNetMap->m_pBase;
}
pData = V_malloc(uSize);
V_memset(pData, 0, uSize);
pCurrentData = pData;
pSync->m_eType = MESSAGE_ENTITY_DATA_SYNC;
for ( i = 0; i < MAX_EDICTS; i++ )
{
if ( m_pEntities[i] != pEntity )
continue;
pSync->m_uIndex = i;
break;
}
pSync->m_uCount = x;
pcCurrentData += sizeof(EntityDataSync_t);
pNetMap = pEntity->GetSendMap();
x = 0;
while ( pNetMap )
{
for ( u = 0; u < pNetMap->m_uFieldCount; u++ )
{
pValue->m_uVariableSize = pNetMap->m_pFields[u].m_uSize;
pValue->m_uVariableIndex = x;
uint32_t uVariableSize;
pcCurrentData += sizeof(EntityDataSyncValue_t);
V_memcpy(pcCurrentData,
pNetMap->m_pFields[u].m_uOffset+(char*)pEntity,
pNetMap->m_pFields[u].m_uSize);
pcCurrentData += (pNetMap->m_pFields[u].m_uSize+7) & ~7;
x++;
}
pNetMap = pNetMap->m_pBase;
}
if (pBase)
pBase->SendPacket({pData, uSize});
V_free(pData);
}

View File

@@ -32,7 +32,7 @@ public:
virtual void Think();
virtual void NetRecvPacket( NetPacket_t *pPacket );
virtual void NetSendThink();
virtual void NetSendThink( INetworkBase *pBase );
virtual C_BaseEntity **GetEntities();
private:

View File

@@ -25,6 +25,7 @@ class CFunnyGameBridge: public IEngineBridge
bool m_bIsConnectedToSteamRelay;
bool m_bIsConnectedToServer;
float m_fNetUpdateTimer;
};
@@ -151,6 +152,15 @@ void CFunnyGameBridge::Frame( float fDelta )
}
EntitySystem()->Think();
float fTickRate = 1.0/60.0;
m_fNetUpdateTimer += fDelta;
while (m_fNetUpdateTimer >= fTickRate)
{
m_fNetUpdateTimer-=fTickRate;
if (pCurrentServer)
EntitySystem()->NetSendThink(pCurrentServer);
}
g_pWorldRenderer->Frame(fDelta);
}

View File

@@ -14,18 +14,20 @@ void C_MOBAPlayer::Spawn()
BaseClass::Spawn();
SetThink(Think);
SetScale(1);
vCameraPos = {0,0,-20};
};
void C_MOBAPlayer::Think( float fDelta )
{
C_MOBAPlayer *pEntity = (C_MOBAPlayer*)UTIL_GetLocalPlayer();
m_vMovementVector.x = m_bIsForward - m_bIsBack;
if (pEntity == this)
{
Vector vCameraPos = GetAbsOrigin();
vCameraPos.z += -20;
g_pWorldRenderer->SetCameraPosition(vCameraPos);
}
BaseClass::Think(fDelta);
};
@@ -37,16 +39,48 @@ END_DATADESC()
IMPLEMENT_RECV_DT(C_MOBAPlayer)
END_RECV_DT()
IMPLEMENT_EMPTY_SEND_DT(C_MOBAPlayer)
IMPLEMENT_SEND_DT(C_MOBAPlayer)
NetPropFloat3(m_vMovementVector),
END_SEND_DT()
static void IN_ForwardDown( int c, char **v ) {
V_printf("+forward\n");
C_BaseEntity *pPlayer = UTIL_GetLocalPlayer();
if (!pPlayer)
return;
if (!dynamic_cast<C_MOBAPlayer*>(pPlayer))
return;
((C_MOBAPlayer*)pPlayer)->m_bIsForward = true;
}
static ConCommand startforward("+forward", IN_ForwardDown);
static void IN_ForwardUp( int c, char **v ) {
V_printf("-forward\n");
C_BaseEntity *pPlayer = UTIL_GetLocalPlayer();
if (!pPlayer)
return;
if (!dynamic_cast<C_MOBAPlayer*>(pPlayer))
return;
((C_MOBAPlayer*)pPlayer)->m_bIsForward = false;
}
static ConCommand endforward("-forward", IN_ForwardUp);
static void IN_BackDown( int c, char **v ) {
C_BaseEntity *pPlayer = UTIL_GetLocalPlayer();
if (!pPlayer)
return;
if (!dynamic_cast<C_MOBAPlayer*>(pPlayer))
return;
((C_MOBAPlayer*)pPlayer)->m_bIsBack = true;
}
static ConCommand startback("+back", IN_BackDown);
static void IN_BackUp( int c, char **v ) {
C_BaseEntity *pPlayer = UTIL_GetLocalPlayer();
if (!pPlayer)
return;
if (!dynamic_cast<C_MOBAPlayer*>(pPlayer))
return;
((C_MOBAPlayer*)pPlayer)->m_bIsBack = false;
}
static ConCommand endback("-back", IN_BackUp);

View File

@@ -15,9 +15,18 @@ public:
virtual void Spawn( void ) override;
void Think( float fDelta );
bool m_bIsForward = 0;
bool m_bIsBack = 0;
bool m_bIsLeft = 0;
bool m_bIsRight = 0;
int m_bIsShooting;
float m_fFBWalkingDirection;
float m_fLRWalkingDirection;
Vector m_vMovementVector;
Vector m_vLocalMovementVector;
Vector vCameraPos;
};
#endif

View File

@@ -52,10 +52,12 @@ public:
DECLARE_DATADESC_NOBASE()
DECLARE_SERVERCLASS_NOBASE()
typedescription_t *FindDataByName( const char *szName );
typedescription_t *FindDataByMapName( const char *szName );
const char *GetClassName();
void SetNetworkOwner( uint64_t ullPlayer );
virtual ~CBaseEntity();
virtual void Precache();
@@ -77,6 +79,7 @@ public:
fnThink m_pfnThink = NULL;
const char *m_szClassName;
uint64_t m_ullOwner;
private:
Vector m_vPosition;
Quat m_vRotation;

View File

@@ -17,6 +17,7 @@ DECLARE_BUILD_STAGE(Server)
compileProject.m_szName = "server";
compileProject.files = {
"../shared/game.cpp",
"../shared/boneanimation.cpp",
"game.cpp",
"assetmgr.cpp",
@@ -46,16 +47,32 @@ DECLARE_BUILD_STAGE(Server)
}
else
{
if ( GET_PROJECT_VALUE(config, "steam") == "true" ) {
ldProject.libraryDirectories.AppendTail(EXTERNAL"steamworks/redistributable_bin/linux64");
ldProject.libraries.AppendTail("steam_api");
}
ldProject.linkType = ELINK_DYNAMIC_LIBRARY;
ldProject.libraryObjects = {
GET_PROJECT_LIBRARY(tier0, "tier0"),
};
ldProject.objects.AppendTail({GET_PROJECT_LIBRARY(tier1, "tier1")});
ldProject.objects.AppendTail({GET_PROJECT_LIBRARY(tier2, "tier2")});
if ( GET_PROJECT_VALUE(config, "steam") == "true" ) {
ldProject.libraryObjects.AppendTail(GET_PROJECT_OBJECT(config, "steam_lib"));
}
if (ldProject.m_target.kernel & TARGET_KERNEL_WINDOWS_DEVICES)
{
ldProject.libraryDirectories.AppendTail(EXTERNAL"windows");
ldProject.libraries.AppendTail("winpthread-1");
ldProject.libraries.AppendTail("ws2_32");
ldProject.libraries.AppendTail("winmm");
ldProject.libraries.AppendTail("ole32");
ldProject.libraries.AppendTail("gdi32");
ldProject.libraries.AppendTail("oleaut32");
ldProject.libraries.AppendTail("setupapi");
ldProject.libraries.AppendTail("imm32");
ldProject.libraries.AppendTail("version");
ldProject.libraries.AppendTail("shell32");
ldProject.libraries.AppendTail("uuid");
};
}
if (ldProject.m_target.kernel & TARGET_KERNEL_WINDOWS_DEVICES)

View File

@@ -132,12 +132,78 @@ void CEntitySystem::Think()
}
}
static void *UTIL_GetNetMapData(CBaseEntity *pEntity, netmap_t *pMap, uint32_t uIndex )
{
netmap_t *pCurrentMap = pMap;
uint32_t uCurrentIndex = uIndex;
searchIndex:
if ( uCurrentIndex < pCurrentMap->m_uFieldCount )
{
return (char*)pEntity+pCurrentMap->m_pFields[uCurrentIndex].m_uOffset;
}
uCurrentIndex -= pCurrentMap->m_uFieldCount;
pCurrentMap = pCurrentMap->m_pBase;
if (!pCurrentMap)
return NULL;
goto searchIndex;
}
void CEntitySystem::NetRecvPacket( NetPacket_t *pPacket )
{
PlayerPacket_t *pPlayerPacket = (PlayerPacket_t*)pPacket->pData;
CBaseEntity *pEntity;
switch (pPlayerPacket->m_eType)
{
case MESSAGE_ENTITY_DATA_SYNC:
if ( pPlayerPacket->m_entityData.m_uIndex >= MAX_EDICTS )
break;
pEntity = m_pEntities[pPlayerPacket->m_entityData.m_uIndex];
// check for owner being moron
if ( pEntity == NULL )
break;
if ( pEntity->m_ullOwner != pPacket->m_uOwner)
break;
union {
void *pData;
char *pcCurrentData;
EntityDataSyncValue_t *pcSyncValue;
};
pData = pPlayerPacket;
pcCurrentData += sizeof(EntityDataSync_t);
// too bad
// this shall be reworked
for ( uint32_t u = 0; u < pPlayerPacket->m_entityData.m_uCount; u++ )
{
uint32_t uVariableSize = pcSyncValue->m_uVariableSize;
void *pValueData = (float*)UTIL_GetNetMapData(
pEntity,
pEntity->GetRecvMap(),
pcSyncValue->m_uVariableIndex);
pcCurrentData += sizeof(EntityDataSyncValue_t);
if (pValueData)
V_memcpy(pValueData, pcCurrentData, uVariableSize);
pcCurrentData += (uVariableSize+7) & ~7;
}
break;
default:
break;
}
}
//-------------------------------------------------------------------------------
// Purpose: Sends packets to clients.
// Since we are running this on server we can't really accept any packet.
// We only allow packets from the entities sent by a client
//-------------------------------------------------------------------------------
void CEntitySystem::NetThink( INetworkBase *pBase )
void CEntitySystem::NetSendThink( INetworkBase *pBase )
{
CBaseEntity *pEntity;
@@ -160,9 +226,6 @@ void CEntitySystem::NetThink( INetworkBase *pBase )
if ( pEntity == NULL )
continue;
if ( !pEntity->m_pfnThink )
continue;
pNetMap = pEntity->GetSendMap();
uSize = sizeof(EntityDataSyncValue_t);
x = 0;
@@ -202,10 +265,9 @@ void CEntitySystem::NetThink( INetworkBase *pBase )
}
pNetMap = pNetMap->m_pBase;
}
if (g_pCurrentConnection)
g_pCurrentConnection->SendPacket({pData, uSize});
if (pBase)
pBase->SendPacket({pData, uSize});
V_free(pData);
}
}
@@ -213,3 +275,16 @@ CBaseEntity **CEntitySystem::GetEntities()
{
return m_pEntities;
}
void CEntitySystem::SetAllowedEntityForPlayer( uint64_t ullPlayer, CBaseEntity *pEntity )
{
if (pEntity)
{
}
else
{
}
}

View File

@@ -25,8 +25,11 @@ public:
virtual IEntityFactory *GetFactoryByClassname( const char *szName );
virtual void Think();
virtual void NetThink( INetworkBase *pBase );
virtual CBaseEntity **GetEntities();
virtual void NetRecvPacket( NetPacket_t *pPacket );
virtual void NetSendThink( INetworkBase *pBase );
virtual void SetAllowedEntityForPlayer( uint64_t ullPlayer, CBaseEntity *pEntity );
private:
CBaseEntity *m_pEntities[MAX_EDICTS];
int m_nEntityCount;

View File

@@ -68,6 +68,7 @@ uint32_t NET_ServerCallback( NetCallback_t *pCallback )
CBaseEntity *pEntity;
pEntity = EntitySystem()->CreateByClassname("player", &iIndex);
pEntity->Spawn();
pEntity->m_ullOwner = pCallback->m_ullUserConnection;
SetLocalEntity_t stLocalEntity = {
k_EMessage_PlayerSetLocalEntity,
@@ -150,9 +151,9 @@ void NET_ProcessPacket( INetworkBase *pBase )
int iIndex = -1;
V_printf("Hi %s\n",pPacket->m_playerJoined.m_szPlayerName);
pEntity = EntitySystem()->CreateByClassname("player", &iIndex);
pEntity->Spawn();
pEntity->m_ullOwner = 0;
SetLocalEntity_t stLocalEntity = {
k_EMessage_PlayerSetLocalEntity,
@@ -162,7 +163,11 @@ void NET_ProcessPacket( INetworkBase *pBase )
g_pCurrentConnection->SendPacket({&stLocalEntity, sizeof(stLocalEntity), 0, PACKET_MUST_ARRIVE});
}
return;
case MESSAGE_ENTITY_DATA_SYNC:
EntitySystem()->NetRecvPacket(&packet);
pBase->RecievePacket();
default:
pBase->RecievePacket();
break;
}
pBase->RecievePacket();
@@ -204,7 +209,7 @@ void CFunnyGameBridge::Frame( float fDelta )
{
g_pPhysicsWorld->Frame(fTickRate);
EntitySystem()->Think();
EntitySystem()->NetThink(g_pCurrentConnection);
EntitySystem()->NetSendThink(g_pCurrentConnection);
}
}

View File

@@ -14,6 +14,7 @@ void CMOBAPlayer::Spawn()
void CMOBAPlayer::Think( float fDelta )
{
V_printf("%f %f %f\n", m_vMovementVector.x, m_vMovementVector.y, m_vMovementVector.z);
CPhysicsProp::Think(fDelta);
};
@@ -25,4 +26,6 @@ END_DATADESC()
IMPLEMENT_SEND_DT(CMOBAPlayer)
END_SEND_DT()
IMPLEMENT_EMPTY_RECV_DT(CMOBAPlayer)
IMPLEMENT_RECV_DT(CMOBAPlayer)
NetPropFloat3(m_vMovementVector)
END_RECV_DT()

View File

@@ -12,6 +12,8 @@ public:
virtual void Spawn( void ) override;
void Think( float fDelta );
private:
Vector m_vMovementVector = {};
};
#endif

View File

View File

@@ -0,0 +1,15 @@
#ifndef BONE_ANIMATION_H
#define BONE_ANIMATION_H
class CBones
{
};
class CBoneAnimator
{
public:
virtual CBones *CreateBones();
};
#endif

View File

@@ -3,7 +3,7 @@
#include "stdint.h"
#include <arpa/inet.h>
#include "tier0/network.h"
class CNetworkUInt32
{

View File

@@ -17,10 +17,10 @@ DECLARE_BUILD_STAGE(launcher)
{
CProject_t compileProject = {};
LinkProject_t ldProject = {};
compileProject.m_szName = "launcher";
compileProject.files = {"launcher.cpp"};
compileProject.includeDirectories = {"../external/SDL/include"};
compileProject.m_target = Target_t::DefaultTarget();
ldProject = ccompiler->Compile(&compileProject);
ldProject.linkType = ELINK_EXECUTABLE;
if (compileProject.m_target.kernel == TARGET_KERNEL_IOS)

View File

@@ -95,6 +95,8 @@ int main( int argc, char **argv ) {
printf("Symbol not found: FunnyMain\n");
}
dirname(szLauncherPath);
SetCurrentDirectoryA(szLauncherPath);
pEngineMain(argc, argv);
#endif

View File

@@ -114,9 +114,9 @@ DECLARE_VULKAN_COMMAND(SetViewport)
{
VkViewport v = {
fX,
fY+fHeight,
fY,
fWidth,
-fHeight,
fHeight,
fDepthMin,
fDepthMax
};

View File

@@ -0,0 +1,5 @@
[target.x86_64-pc-windows-gnu]
rustflags = ["-C", "target-feature=+crt-static"]
[target.aarch64-apple-ios]
rustflags = ["-C", "link-arg=-mios-version-min=13.0"]

View File

@@ -3,8 +3,6 @@ name = "rapier_rtt"
version = "0.1.0"
edition = "2021"
[target.aarch64-apple-ios]
rustflags = ["-C", "link-arg=-mios-version-min=13.0"]
[lib]
crate-type = ["staticlib"]

View File

@@ -53,6 +53,25 @@ DECLARE_BUILD_STAGE(rapier)
linkProject.linkType = ELINK_DYNAMIC_LIBRARY;
linkProject.objects.AppendTail({rapier_lib});
linkProject.objects.AppendTail({GET_PROJECT_OBJECT(tier1, "tier1")});
linkProject.libraryObjects.AppendTail(GET_PROJECT_OBJECT(tier0, "tier0"));
if (linkProject.m_target.kernel & TARGET_KERNEL_WINDOWS_DEVICES)
{
linkProject.libraryDirectories.AppendTail(EXTERNAL"windows");
linkProject.libraries.AppendTail("winpthread-1");
linkProject.libraries.AppendTail("ws2_32");
linkProject.libraries.AppendTail("ntdll");
linkProject.libraries.AppendTail("userenv");
linkProject.libraries.AppendTail("winmm");
linkProject.libraries.AppendTail("ole32");
linkProject.libraries.AppendTail("gdi32");
linkProject.libraries.AppendTail("oleaut32");
linkProject.libraries.AppendTail("setupapi");
linkProject.libraries.AppendTail("imm32");
linkProject.libraries.AppendTail("version");
linkProject.libraries.AppendTail("shell32");
linkProject.libraries.AppendTail("uuid");
};
CUtlString sz_libRapierPhysics = linker->Link(&linkProject);
ADD_OUTPUT_OBJECT("physics", sz_libRapierPhysics);

View File

@@ -146,7 +146,7 @@ pub unsafe extern "C" fn CRapierPhysicsBody_GetRotation( this: *mut RapierPhysic
#[no_mangle]
pub unsafe extern "C" fn CRapierPhysicsWorld_Frame( this: *mut RapierWorld_t, fDelta: f32 )
{
let vGravity = vec3(0.0, -0.0, 0.0);
let vGravity = vec3(0.0, -9.8, 0.0);
let mut integrationParameters = IntegrationParameters::default();
integrationParameters.dt = fDelta;
let mut physicsPipeline = PhysicsPipeline::new();