да сказанул, я конечно на счёт джонтов
вот
тут меши загружаю а из них боди делаю.
arenM=LoadMesh ("aren.b3d")
PositionEntity arenM,0,0,0
arenB=BodyCreateMeshB(arenM,0)
rolm=LoadMesh("rol.b3d")
ScaleEntity rolm,1,1,1
rolb=BodyCreateMesh(rolm,70)
pxBodySetPosition rolb,3,57.65,-1.8
pxBodySetRotation rolb,0,-90,0
rolm2=LoadMesh("rol.b3d")
ScaleEntity rolm2,1,1,1
rolb2=BodyCreateMesh(rolm2,70)
pxBodySetPosition rolb2,-2.5,57.7,-1.8
pxBodySetRotation rolb2,0,-90,0
rolm3=LoadMesh("rol.b3d")
ScaleEntity rolm3,1,1,1
rolb3=BodyCreateMesh(rolm3,70)
pxBodySetPosition rolb3,-2.5,57.7,1.8
pxBodySetRotation rolb3,0,-90,180
rolm4=LoadMesh("rol.b3d")
ScaleEntity rolm4,1,1,1
rolb4=BodyCreateMesh(rolm4,70)
pxBodySetPosition rolb4,3,57.65,1.8
pxBodySetRotation rolb4,0,-90,180
UAZM=LoadMesh("body.b3d")
ScaleEntity UAZM,1,1,1
UAZB=BodyCreateMesh(UAZM,1200)
pxBodySetPosition UAZB,0,60,0
;pxbodysetscaleentity
-------
дальше их скрепляю
(blk=pxJointCreateSuspBack(UAZB,rolb,3,57.65,-1.
pxJointSuspSetLinLimit(blk, 0.2)
pxJointSuspSetLinParameter(blk, 10000,10,10)
blk2=pxJointCreateSuspFront(UAZB,rolb2,-2.5,57.7,-1.
pxJointSuspSetLinLimit(blk2, 0.3)
pxJointSuspSetLinParameter(blk2, 10000,10,10)
blk3=pxJointCreateSuspFront(UAZB,rolb3,-2.5,57.7,1.
pxJointSuspSetLinLimit(blk3, 0.3)
pxJointSuspSetLinParameter(blk3, 10000,10,10)
blk4=pxJointCreateSuspBack(UAZB,rolb4,3,57.65,1.
pxJointSuspSetLinLimit(blk4, 0.2)
pxJointSuspSetLinParameter(blk4, 10000,10,10))
---------------------------
ну а тут вот и стопорюсь
While Not KeyHit(1)
pxRenderPhysic(30,0)
PositionEntity camera,EntityX(uazm),EntityY(uazm)+20,EntityZ(uazm )-30
If KeyDown (200)
n1#=n1+0.01
If n1>500 n1=500
Else If KeyDown (20
n1#=n1-1
If n1<-15 n1=-15
Else
n1=0
;If n1<0 n1=0
EndIf
If KeyDown (203)
angle# =angle -1
If angle<-50 angle=-50
key=1
Else If KeyDown (205)
angle# =angle +1
If angle>50 angle=50
key=2
Else If angle<0
angle# =angle +1
Else If angle>0
angle# =angle -1
EndIf
pxJointSuspSetAngle(blk2, angle)
pxJointSuspSetAngle(blk3, angle)
;pxBodySetLinearSpeed(rolb,-n1*10,0,0)
;pxBodySetLinearSpeed(rolb4,n1*10,0,0)
pxBodySetLocalAngularSpeed(rolb,-n1*1000,0,0)
pxBodySetLocalAngularSpeed(rolb4,n1*1000,0,0)
;pxBodyAddTorque(rolb3,0,angle*1000,0,2)
;pxBodyAddTorque(rolb2,0,angle*1000,0,2)
pxBodySetEntity (UAZM,UAZ
pxBodySetEntity (rolm,rolb)
pxBodySetEntity (rolm2,rolb2)
pxBodySetEntity (rolm3,rolb3)
pxBodySetEntity (rolm4,rolb4)
UpdateWorld ()
RenderWorld ()
Flip
Wend
End
Function BodyCreateMesh(mesh,mass)
Local nsurf = CountSurfaces(mesh)
Local nvert = 0
For ns = 1 To nsurf
Local surf = GetSurface(mesh,ns)
nvert = nvert + CountVertices(surf)
Next
vbank = CreateBank(nvert*4*3)
nv = 0
For ns = 1 To nsurf
surf = GetSurface(mesh,ns)
nvv = CountVertices(surf)
For nvc = 0 To nvv - 1
PokeFloat vbank,nv*12+0,VertexX(surf,nvc)
PokeFloat vbank,nv*12+4,VertexY(surf,nvc)
PokeFloat vbank,nv*12+8,VertexZ(surf,nvc)
nv = nv+1
Next
Next
Local bbb%= pxBodyCreateHull(vbank, nvert,mass)
FreeBank vbank
Return bbb
End Function
Function BodyCreateMeshB(mesh,mass)
nsurf = CountSurfaces(mesh)
nvert = 0
nface=0
For ns = 1 To nsurf
Local surf = GetSurface(mesh,ns)
nface = nface+CountTriangles(surf)
nvert = nvert +CountVertices(surf)
Next
fbank = CreateBank(nface*4*3)
nf = 0
vbank = CreateBank(nvert*4*3)
nv = 0
For ns = 1 To nsurf
surf = GetSurface(mesh,ns)
nfv = CountTriangles(surf)
For nfc = 0 To nfv -1
PokeInt fbank,nf*12+0,TriangleVertex(surf,nfc,0)
PokeInt fbank,nf*12+4,TriangleVertex(surf,nfc,1)
PokeInt fbank,nf*12+8,TriangleVertex(surf,nfc,2)
nf=nf+1
Next
nvv = CountVertices(surf)
For nvc = 0 To nvv - 1
PokeFloat vbank,nv*12+0,VertexX(surf,nvc)
PokeFloat vbank,nv*12+4,VertexY(surf,nvc)
PokeFloat vbank,nv*12+8,VertexZ(surf,nvc)
nv = nv+1
Next
Next
bbb%=pxCreateTriMesh(vbank, fbank, nvert, nface,mass)
FreeBank vbank
FreeBank fbank
Return bbb%
End Function