Ejemplo n.º 1
0
    public void GenerateDragCoefficientGraph()
    {
        dragGraph = DragGraphGenerator2.GenerateDragCurve(
            this,
            100,
            4.0f
            );

        isGraphGenerated = true;
    }
Ejemplo n.º 2
0
    AnimationCurve GenerateDragGraph(SerializedProperty propery)
    {
        GetAllSerializedProperties(propery);

        ProjectileData proj = new ProjectileData();

        //Set all values
        proj.bulletDiameter     = this.bulletDiameter.floatValue;
        proj.bulletLength       = this.bulletLength.floatValue;
        proj.baseDiameter       = this.baseDiameter.floatValue;
        proj.cylinderLength     = this.cylinderLength.floatValue;
        proj.noseLength         = this.noseLength.floatValue;
        proj.noseVirtualLength  = this.noseVirtualLength.floatValue;
        proj.meplatDiameter     = this.meplatDiameter.floatValue;
        proj.ogiveRadius        = this.ogiveRadius.floatValue;
        proj.ogiveTangentRadius = this.ogiveTangentRadius.floatValue;
        proj.boatTailDiameter   = this.boatTailDiameter.floatValue;
        proj.boatTailAngle      = this.boatTailAngle.floatValue;
        proj.boatTailLength     = this.boatTailLength.floatValue;
        proj.driveBandDiameter  = this.driveBandDiameter.floatValue;
        proj.driveBandLength    = this.driveBandLength.floatValue;
        proj.driveBandBevel     = this.driveBandBevel.floatValue;
        proj.hasDriveBand       = this.hasDriveBand.boolValue;
        proj.graphIterations    = this.graphIterations.intValue;
        proj.bulletMass         = this.bulletMass.floatValue;
        proj.centerOfMass       = this.centerOfMass.floatValue;
        proj.boundaryLayerCode  = (BoundaryLayerCode)this.boundaryLayerCode.enumValueIndex;

        proj.dragGraph =
            DragGraphGenerator2.GenerateDragCurve(
                proj,
                proj.graphIterations,
                4.0f                 //In mach
                );

        proj.InitGraphSettings();

        return(proj.dragGraph);
    }