Results 1 to 3 of 3

Thread: [advanced] movegravity() and movement vectors

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    A 'reversed' movegravity function in case anyone wants to 'mess around with' in libcod:

    PHP Code:
    void gsc_entity_movegravity(scr_entref_t id)
    {
        
    vec3_t dir;
        
    float time;

        if ( ! 
    stackGetParams("vf", &dir, &time))
        {
            
    stackError("gsc_entity_movegravity() one or more arguments is undefined or has a wrong type");
            
    stackPushUndefined();
            return;
        }

        
    gentity_t *entity = &g_entities[id];

        
    entity->s.pos.trType TR_GRAVITY;
        
    entity->s.pos.trTime level.time;
        
    entity->s.pos.trDuration time 1000.0;

        
    VectorCopy(entity->r.currentOriginentity->s.pos.trBase);
        
    VectorCopy(direntity->s.pos.trDelta);

        
    BG_EvaluateTrajectory(&entity->s.poslevel.timeentity->r.currentOrigin);
        
    SV_LinkEntity(entity);

        
    stackPushBool(qtrue);

    sudo apt-get rekt

  2. The Following User Says Thank You to voron00 For This Useful Post:

    kung foo man (6th January 2019)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •