mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-15 14:10:11 +00:00
9708392322
add UDP network connection for physics client <-> server. also set spinning friction in rolling friction demo (otherwise objects may keep on spinning forever)
22 lines
488 B
C++
22 lines
488 B
C++
|
|
#include "PhysicsClientUDP_C_API.h"
|
|
#include "PhysicsClientUDP.h"
|
|
#include "PhysicsDirect.h"
|
|
#include <stdio.h>
|
|
|
|
//think more about naming. The b3ConnectPhysicsLoopback
|
|
b3PhysicsClientHandle b3ConnectPhysicsUDP(const char* hostName, int port)
|
|
{
|
|
|
|
UdpNetworkedPhysicsProcessor* udp = new UdpNetworkedPhysicsProcessor(hostName, port);
|
|
|
|
PhysicsDirect* direct = new PhysicsDirect(udp);
|
|
|
|
bool connected = direct->connect();
|
|
printf("direct!\n");
|
|
return (b3PhysicsClientHandle)direct;
|
|
}
|
|
|
|
|
|
|