示例#1
0
 /// <summary>Create this particle group in the simulation with a shape pointer you already have
 /// Note: Used for concave fixtures or fixtures with more than 8 vertices
 /// They are broken up into several fixtures </summary>
 protected override void InitialiseWithShape(IntPtr shape)
 {
     SubPtrs.Add(LPAPIParticleGroups.CreateParticleGroup(sys.GetPtr(), getPartNum(), getGroupNum(), 0f, Strenght, AngularVelocity
                                                         , LinearVelocity.x, LinearVelocity.y
                                                         , shape
                                                         , (int)(_Color.r * 255f), (int)(_Color.g * 255f), (int)(_Color.b * 255f), (int)(_Color.a * 255f)
                                                         , Stride, LifeTime, UserData)
                 );
 }
示例#2
0
    /// <summary>Create this particle group in the simulation</summary>
    public void Initialise(LPParticleSystem s)
    {
        sys = s;
        IntPtr shape = GetShape();

        ThingPtr = LPAPIParticleGroups.CreateParticleGroup(sys.GetPtr(), getPartNum(), getGroupNum(), 0f, Strenght, AngularVelocity
                                                           , LinearVelocity.x, LinearVelocity.y
                                                           , shape
                                                           , (int)(_Color.r * 255f), (int)(_Color.g * 255f), (int)(_Color.b * 255f), (int)(_Color.a * 255f)

                                                           , Stride, LifeTime, UserData);
        LPAPIUtility.ReleaseShape(shape);

        if (SubPtrs != null && ParticlesMaterial != null && (ParticlesMaterial.elastic || ParticlesMaterial.spring))
        {
            foreach (IntPtr groupptr in SubPtrs)
            {
                LPAPIParticleGroups.JoinParticleGroups(sys.GetPtr(), ThingPtr, groupptr);
            }
        }
    }