@@ -39,32 +39,49 @@ bool NeedsNativeMapping( openplx.Core.Object obj )
3939 } ;
4040 }
4141
42- internal agx . Referenced FindCorrespondingNative ( OpenPLX . OpenPLXRoot root , openplx . Core . Object obj ) => obj switch
42+ internal agx . Referenced FindCorrespondingNative ( OpenPLX . OpenPLXRoot root , openplx . Core . Object obj )
4343 {
44- Interactions . Lock => GetNativeConstraint ( ) . asLockJoint ( ) ,
45- Interactions . Hinge => GetNativeConstraint ( ) . asHinge ( ) ,
46- Interactions . Prismatic => GetNativeConstraint ( ) . asPrismatic ( ) ,
47- Interactions . Cylindrical => GetNativeConstraint ( ) . asCylindricalJoint ( ) ,
48- Interactions . Ball => GetNativeConstraint ( ) . asBallJoint ( ) ,
49- Interactions . Distance => GetNativeConstraint ( ) . asDistanceJoint ( ) ,
50- Interactions . RotationalRange => GetGeneric1DOFNative ( ) . getRange1D ( ) ,
51- Interactions . TorsionSpring => GetGeneric1DOFNative ( ) . getLock1D ( ) ,
52- Interactions . RotationalVelocityMotor => GetGeneric1DOFNative ( ) . getMotor1D ( ) ,
53- Interactions . TorqueMotor => GetGeneric1DOFNative ( ) . getMotor1D ( ) ,
54- Interactions . LinearRange => GetGeneric1DOFNative ( ) . getRange1D ( ) ,
55- Interactions . LinearSpring => GetGeneric1DOFNative ( ) . getLock1D ( ) ,
56- Interactions . LinearVelocityMotor => GetGeneric1DOFNative ( ) . getMotor1D ( ) ,
57- Interactions . ForceMotor => GetGeneric1DOFNative ( ) . getMotor1D ( ) ,
58- openplx . Physics . Geometries . ContactGeometry => gameObject . GetInitializedComponent < Shape > ( ) . NativeGeometry ,
59- Interactions . MateConnector => gameObject . GetInitializedComponent < ObserverFrame > ( ) . Native ,
60- openplx . Physics3D . Bodies . RigidBody => gameObject . GetInitializedComponent < RigidBody > ( ) . Native ,
61- openplx . Terrain . Terrain => gameObject . GetInitializedComponent < MovableTerrain > ( ) . Native ,
62- openplx . Terrain . Shovel => gameObject . GetInitializedComponent < DeformableTerrainShovel > ( ) . Native ,
63- openplx . Sensors . SensorLogic => gameObject . GetInitializedComponent < LidarSensor > ( ) . Native ,
64- openplx . Vehicles . Steering . Interactions . DualSuspensionSteering => gameObject . GetInitializedComponent < Steering > ( ) . Native ,
65- openplx . Vehicles . Suspensions . Interactions . LinearSpringDamperMate => gameObject . GetInitializedComponent < WheelJoint > ( ) . Native ,
66- _ => DefaultHandling ( obj )
67- } ;
44+ if ( obj . getOwner ( ) is openplx . Vehicles . Suspensions . SingleMate . Base wj ) {
45+ if ( obj == wj . range ( ) )
46+ return gameObject . GetInitializedComponent < WheelJoint > ( ) . GetController < RangeController > ( WheelJoint . WheelDimension . Suspension ) . Native ;
47+ else if ( obj == wj . mate ( ) )
48+ return gameObject . GetInitializedComponent < WheelJoint > ( ) . Native ;
49+ }
50+
51+ if ( obj . getOwner ( ) is openplx . Vehicles . Steering . Kinematic . Base steer ) {
52+ if ( obj == steer . interaction ( ) )
53+ return gameObject . GetInitializedComponent < Steering > ( ) . Native ;
54+ }
55+
56+ return obj switch
57+ {
58+ Interactions . Lock => GetNativeConstraint ( ) . asLockJoint ( ) ,
59+ Interactions . Hinge => GetNativeConstraint ( ) . asHinge ( ) ,
60+ Interactions . Prismatic => GetNativeConstraint ( ) . asPrismatic ( ) ,
61+ Interactions . Cylindrical => GetNativeConstraint ( ) . asCylindricalJoint ( ) ,
62+ Interactions . Ball => GetNativeConstraint ( ) . asBallJoint ( ) ,
63+ Interactions . Distance => GetNativeConstraint ( ) . asDistanceJoint ( ) ,
64+ Interactions . RotationalRange => GetGeneric1DOFNative ( ) . getRange1D ( ) ,
65+ Interactions . TorsionSpring => GetGeneric1DOFNative ( ) . getLock1D ( ) ,
66+ Interactions . RotationalVelocityMotor => GetGeneric1DOFNative ( ) . getMotor1D ( ) ,
67+ Interactions . TorqueMotor => GetGeneric1DOFNative ( ) . getMotor1D ( ) ,
68+ Interactions . LinearRange => GetGeneric1DOFNative ( ) . getRange1D ( ) ,
69+ Interactions . LinearSpring => GetGeneric1DOFNative ( ) . getLock1D ( ) ,
70+ Interactions . LinearVelocityMotor => GetGeneric1DOFNative ( ) . getMotor1D ( ) ,
71+ Interactions . ForceMotor => GetGeneric1DOFNative ( ) . getMotor1D ( ) ,
72+ openplx . Physics . Geometries . ContactGeometry => gameObject . GetInitializedComponent < Shape > ( ) . NativeGeometry ,
73+ Interactions . MateConnector => gameObject . GetInitializedComponent < ObserverFrame > ( ) . Native ,
74+ openplx . Physics3D . Bodies . RigidBody => gameObject . GetInitializedComponent < RigidBody > ( ) . Native ,
75+ openplx . Terrain . Terrain => gameObject . GetInitializedComponent < MovableTerrain > ( ) . Native ,
76+ openplx . Terrain . Shovel => gameObject . GetInitializedComponent < DeformableTerrainShovel > ( ) . Native ,
77+ openplx . Sensors . SensorLogic => gameObject . GetInitializedComponent < LidarSensor > ( ) . Native ,
78+ openplx . Vehicles . Steering . Kinematic . Base => gameObject . GetInitializedComponent < Steering > ( ) . Native ,
79+ openplx . Vehicles . Steering . Kinematic . Interactions . Base => gameObject . GetInitializedComponent < Steering > ( ) . Native ,
80+ openplx . Vehicles . Suspensions . SingleMate . Base => gameObject . GetInitializedComponent < WheelJoint > ( ) . Native ,
81+ openplx . Vehicles . Suspensions . SingleMate . Interactions . Base => gameObject . GetInitializedComponent < WheelJoint > ( ) . Native ,
82+ _ => DefaultHandling ( obj )
83+ } ;
84+ }
6885
6986 [ field: SerializeField ]
7087 [ DisableInRuntimeInspector ]
0 commit comments