コード例 #1
0
ファイル: shapeTester.cs プロジェクト: Morusque/shape-morpher
	void setRageSpline(Vector2[] splinePoints) {
		rageSpline = GetComponent<RageSpline>();
		rageSpline.ClearPoints();
		for (int i=0;i<splinePoints.Length;i++) {
			rageSpline.AddPoint(0, new Vector3(splinePoints[i].x,splinePoints[i].y,0),new Vector3(0,0,0));
		}
		rageSpline.RefreshMesh();
	}
コード例 #2
0
ファイル: tile.cs プロジェクト: Morusque/Archipelago
    void setRageSpline(Vector2[] splinePoints)
    {
        IRageSpline rageSpline = GetComponent <RageSpline>();

        rageSpline.ClearPoints();
        for (int i = 0; i < splinePoints.Length; i++)
        {
            rageSpline.AddPoint(0, new Vector3(splinePoints[i].x, splinePoints[i].y, 0), new Vector3(0, 0, 0));
        }
        rageSpline.RefreshMesh();
    }
コード例 #3
0
    public void CreateNewLandscape()
    {
        //transform.position = new Vector3(0f,0f,0f);

        pointGapWidth = (startX2 - startX) / (float)(pointCount - 1);

        rageSpline.ClearPoints();
        for (int i = 0; i < pointCount; i++)
        {
            float x = startX + (float)i * pointGapWidth;
            curSteepness = steepness + x * 0.00001f;
            rageSpline.AddPointWorldSpace(i, GetNewLandscapePoint(x), transform.right * pointGapWidth * 0.33f);
        }

        rageSpline.SetPoint(0, new Vector3(rageSpline.GetPosition(0).x, 0f, 0f));
        rageSpline.SetPoint(1, new Vector3(rageSpline.GetPosition(1).x, 0f, 0f));

        rageSpline.RefreshMesh();
    }