Announcement

Collapse
No announcement yet.

Rotating joints

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    oh and BTW format life;

    Wicked Pingune and I are making a military Mod so you can have a hole tone of em.

    Leave a comment:


  • replied
    WOOT it works well sept i dont need roll but it still works

    var rotator R;
    var Rotator i;
    var () int SpinSpeed;

    function PostNetBeginPlay()
    {
    i.Roll=65535;
    SpinSpeed=200;
    R.Roll=0;

    super.PostNetBeginPlay();
    }

    function Tick(float DeltaTime)
    {
    spinRotor(DeltaTime);
    }

    function spinRotor (float DeltaTime)
    {
    if (R.Roll >= i.Roll)
    R.Roll = 0;

    R.Roll += SpinSpeed * DeltaTime;
    SetBoneRotation('Rotor', R, 0, 1);
    }

    thanks.

    Leave a comment:


  • replied
    Originally posted by Format Life:
    ...BTW - Hows the WoE making going?
    It's going alright. I didn't manage to recruit quite as many team members as I would have liked, but it will still get done, just a little slower.

    Leave a comment:


  • replied
    Ohh, I wan't an apache!

    BTW - Hows the WoE making going?

    Leave a comment:


  • replied
    That's the idea, but ticks don't occur at regular intervals so adding a constant amount will result in unstable rotational speed. You need to make use of the DeltaTime parameter (how many seconds since last tick), e.g.
    Code:
    var rotator R;
    
    simulated function Tick(float DeltaTime)
    {
    	SpinRotor(DeltaTime);
    }
    
    simulated function SpinRotor(float DeltaTime)
    {
    	R.Roll += SpinSpeed * DeltaTime;
    	SetBoneRotation('Bone_Barrel', R, 0, 1);
    }

    Leave a comment:


  • replied
    ok thats messed up so here is this and it compiled right

    simulated function Tick(float DeltaTime)
    {
    SpinRotor();
    }

    simulated function spinRotor ()
    {
    local Rotator R;
    local Rotator i;
    i.roll=65535;

    if (R.roll >= i.roll)
    R.roll=0;

    R.roll+=20;
    SetBoneRotation('Rotor', R, 0, 1);
    }

    Leave a comment:


  • replied
    so inside the tick function i would do that?

    also can i just incurment the rad by 1 or somthing then when it gets to 360 (65535) set it back to 0

    like
    int i;
    i=0
    function tick ()
    {

    if (i >= 65535)
    i=0

    i+=10
    SetBoneRotation('Bone_Barrel', i, 0, 1);
    }

    i see that it has to be a rotaror but can you look at it and fix it plzz.

    Leave a comment:


  • replied
    No, it's not used for any vehicles, but the principle is the same wherever it is used: Increment the rotation a bit every tick.

    Leave a comment:


  • replied
    mmm i did a search with Wotgreal and that wasnever used in anything super of the vehicles...

    so is there any thing else?

    Leave a comment:


  • replied
    thanks for the info now i know what to look for.

    Leave a comment:


  • replied
    Here's an example from the Rocket Launcher code, where it's used to rotate the barrels as rockets are loaded:
    Code:
    simulated function UpdateBarrel(float dt)
    {
        local Rotator R;
    
        BarrelRotation += dt * 65535.0 * BARREL_ROTATION_RATE / NUM_BARRELS;
        if (BarrelRotation > FinalRotation)
        {
            BarrelRotation = FinalRotation;
            bRotateBarrel = false;
        }
    
        R.Roll = BarrelRotation;
        SetBoneRotation('Bone_Barrel', R, 0, 1);
    }
    It is called every tick that the barrels are rotating. Search the source code for more examples, and look on the Wiki.

    Leave a comment:


  • replied
    could you give me an example. or what file ut2004 uses to make the wheels turn on a vehicle?

    Leave a comment:


  • replied
    You want SetBoneRotation.

    Leave a comment:


  • started a topic Rotating joints

    Rotating joints

    i am making an ah/64-d longbow apache and i need to beable to rotate the joint (rotors)

    so

    if (bDriving)
    {
    // what do i put here to rotate the joints
    }
    else
    {
    //what do i put here to make them stop???
    }

    thanks
Working...
X