- 最后登录
- 2016-3-30
- 注册时间
- 2012-10-30
- 阅读权限
- 70
- 积分
- 4125
- 纳金币
- 4097
- 精华
- 0
|
在构造方法里加两个参数tileU:uint=1,tileV:uint=1
横向平铺数量 纵向平铺数量
对应修改原始的代码就可以了
var segmentUSize:Number = tileU/widthSegments;
var segmentVSize:Number = tileV/lengthSegments;
public function Plane(width:Number = 100, length:Number = 100, widthSegments:uint = 1, lengthSegments:uint = 1,tileU:uint=1,tileV:uint=1, twoSided:Boolean = ***e, reverse:Boolean = false, bottom:Material = null, top:Material = null) {
if (widthSegments <= 0 || lengthSegments <= 0) return;
var indices:Vector.<uint> = new Vector.<uint>();
var x:int;
var y:int;
var wEdges:int = widthSegments + 1;
var lEdges:int = lengthSegments + 1;
var halfWidth:Number = width*0.5;
var halfLength:Number = length*0.5;
var segmentUSize:Number = tileU/widthSegments;
var segmentVSize:Number = tileV/lengthSegments;
var segmentWidth:Number = width/widthSegments;
var segmentLength:Number = length/lengthSegments;
|
|