Using Articulated Parts in VR-Forces
If an actuator has an articulated parts list, when the actuator is being initialized, it goes through its articulated parts lists and creates the articulated part and the associated state repository. All you need to do is add your articulated parts list to the actuator with the proper articulated part types enumerations and articulated parts parameter types enumerations in the entity's ope file. Here is an example:
Let's look at the M1A2_1_1_1_225_1_1_3_-1.ope file. Below is the section descriping the main turrent of the tank. Comments explain how the articulated parts work for the turret actuator:
(turret (component-descriptor-type "turret-component-descriptor") (component-type "turret-actuator") (min-tick-period -1.000000) (min-tick-period-variance -1.000000) (process-state-repository-name "") (process-state-repository-type "") (art-part-list ;; This is the DtSimArtPartDescriptorList, all the
;; articulated parts associated with the turret act. ;; In this case we just have one (primary-turret ;; DtSimArtPartDescriptor for a primary to turret (art-part-type 4096) ;; value for dis enum type ;; DtPrimaryTurret1--From/ disEnums.h/ in ;; vrlink\include (parent-part-type -1) ;; The articulated part this part is ;; attached to. In this case the turret ;; is attached to the base entity--the tank. (attach-point 0.200000 0.000000 -2.000000) ;; Place on the parent ;; type that this turret should be attached to (art-part-param-list ;; This is the DtSimArtPartParamList that ;; lists all the parameters used to describe ;; how this turrent can move. These parameters ;; are just a list of integers that correspond ;; to the DtArtParamType enums from /disEnums.h/ (part-type 11) ;; value for dis enum type DtApAzimuth to ;; describe rotational angle of the turret (part-type 12) ;; value for dis enum type DtApAzimuthRate ;; to describe the rate at which the turret can ;;rotate. ) ) ) (max-slew-rate 1.700000) )
If you want to do more than rotation or elevation then you will need to extent the DtVrfObjectStateRepository::createParts() function. This is where your entity goes through all its actuator descriptors and their associated articulated parts lists to create those articulated parts and the associated articulated parts state repositories.
You might be suprised how much you can do with the current parameter types. The machine gun of the M1A2 is actually a series of parts. It is comprised of machine gun (art-part type 6016 - A primary gun with elevation parameters) mounted on top of the machine gun turret (part type 5696 - a secondary turret with rotational parameters) mounted on top of the main turret (part type 4096 - a primary turret with rotational parameters). The two turrets allow the main gun to be pointed one direction but the machine gun to be pointed another. Be sure each part has a unique part type otherwise the entity will think it's guns are switching their mounting points, that is, if both the machine gun turrent and the main turret have type 4096 then the entity will continuously send out articulated parts changed messages and will flood your network causing very low frame rates.
