• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang vmath.NewAABB函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/thinkofdeath/steven/type/vmath.NewAABB函数的典型用法代码示例。如果您正苦于以下问题:Golang NewAABB函数的具体用法?Golang NewAABB怎么用?Golang NewAABB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NewAABB函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: CollisionBounds

func (b *blockPistonHead) CollisionBounds() []vmath.AABB {
	if b.bounds == nil {
		b.bounds = []vmath.AABB{
			vmath.NewAABB(0, 0, 0, 1.0, 1.0, 4.0/16.0),
			vmath.NewAABB(6.0/16.0, 6.0/16.0, 4.0/16.0, 10.0/16.0, 10.0/16.0, 1.0),
		}
		if !b.Short {
			b.bounds[1].Max[2] += 4.0 / 16.0
		}
		for i := range b.bounds {
			switch b.Facing {
			case direction.North:
			case direction.South:
				b.bounds[i] = b.bounds[i].RotateY(-math.Pi, 0.5, 0.5, 0.5)
			case direction.West:
				b.bounds[i] = b.bounds[i].RotateY(-math.Pi*1.5, 0.5, 0.5, 0.5)
			case direction.East:
				b.bounds[i] = b.bounds[i].RotateY(-math.Pi*0.5, 0.5, 0.5, 0.5)
			case direction.Up:
				b.bounds[i] = b.bounds[i].RotateX(-math.Pi*1.5, 0.5, 0.5, 0.5)
			case direction.Down:
				b.bounds[i] = b.bounds[i].RotateX(-math.Pi*0.5, 0.5, 0.5, 0.5)
			}
		}
	}
	return b.bounds
}
开发者ID:ammaraskar,项目名称:steven,代码行数:27,代码来源:blockimpl.go


示例2: CollisionBounds

func (b *baseBlock) CollisionBounds() []vmath.AABB {
	if b.bounds == nil {
		b.bounds = []vmath.AABB{
			vmath.NewAABB(0, 0, 0, 1.0, 1.0, 1.0),
		}
	}
	return b.bounds
}
开发者ID:num5,项目名称:steven,代码行数:8,代码来源:block.go


示例3: renderBuffer

func renderBuffer(ch *ChunkBuffer, po position, fr direction.Type, delta float64) {
	if ch == nil {
		return
	}
	rQueue.Append(renderRequest{ch, po, fr})

	slidy := slidyChunks.Value()

	for !rQueue.Empty() {
		req := rQueue.Take()
		if req.chunk.renderedOn == frameID {
			continue
		}
		req.chunk.renderedOn = frameID

		aabb := vmath.NewAABB(
			-float32((req.pos.X<<4)+16), -float32((req.pos.Y<<4)+16), float32((req.pos.Z<<4)),
			-float32((req.pos.X<<4)), -float32((req.pos.Y<<4)), float32((req.pos.Z<<4)+16),
		).Grow(1, 1, 1)
		if !frustum.IsAABBInside(aabb) {
			continue
		}
		renderOrder = append(renderOrder, req.chunk)

		req.chunk.Rendered = true

		if slidy {
			dx := req.pos.X - int(Camera.X)>>4
			dz := req.pos.Z - int(Camera.Z)>>4

			if req.chunk.progress < 1 && dx*dx+dz*dz > 6*6 {
				req.chunk.progress += delta * 0.015
			} else {
				req.chunk.progress = 1
			}
		} else {
			req.chunk.progress = 1
		}

		if req.chunk.count != 0 && req.chunk.buffer.IsValid() {
			shaderChunk.Offset.Int3(req.chunk.X, req.chunk.Y*4096-req.chunk.Y*int(4096*(1-req.chunk.progress)), req.chunk.Z)

			req.chunk.array.Bind()
			gl.DrawElements(gl.Triangles, req.chunk.count, elementBufferType, 0)
		}

		for _, dir := range direction.Values {
			c := req.chunk.neighborChunks[dir]
			if dir != req.from && c != nil && c.renderedOn != frameID &&
				(req.from == direction.Invalid || (req.chunk.IsVisible(req.from, dir) && validDirs[dir])) {
				ox, oy, oz := dir.Offset()
				pos := position{req.pos.X + ox, req.pos.Y + oy, req.pos.Z + oz}
				rQueue.Append(renderRequest{c, pos, dir.Opposite()})
			}
		}
	}
}
开发者ID:num5,项目名称:steven,代码行数:57,代码来源:render.go


示例4: newSheep

func newSheep() Entity {
	type sheep struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	s := &sheep{
		debugComponent: debugComponent{232, 232, 232},
	}
	s.NetworkID = 91
	s.bounds = vmath.NewAABB(-0.45, 0, -0.45, 0.9, 1.3, 0.9)
	return s
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例5: newPig

func newPig() Entity {
	type pig struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	p := &pig{
		debugComponent: debugComponent{252, 0, 194},
	}
	p.NetworkID = 90
	p.bounds = vmath.NewAABB(-0.45, 0, -0.45, 0.9, 0.9, 0.9)
	return p
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例6: newChicken

func newChicken() Entity {
	type chicken struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	c := &chicken{
		debugComponent: debugComponent{217, 217, 217},
	}
	c.NetworkID = 93
	c.bounds = vmath.NewAABB(-0.2, 0, -0.2, 0.4, 0.7, 0.4)
	return c
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例7: newCow

func newCow() Entity {
	type cow struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	c := &cow{
		debugComponent: debugComponent{125, 52, 0},
	}
	c.NetworkID = 92
	c.bounds = vmath.NewAABB(-0.45, 0, -0.45, 0.9, 1.3, 0.9)
	return c
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例8: newWolf

func newWolf() Entity {
	type wolf struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	w := &wolf{
		debugComponent: debugComponent{148, 148, 148},
	}
	w.NetworkID = 95
	w.bounds = vmath.NewAABB(-0.3, 0, -0.3, 0.6, 0.8, 0.6)
	return w
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例9: newSquid

func newSquid() Entity {
	type squid struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	s := &squid{
		debugComponent: debugComponent{84, 39, 245},
	}
	s.NetworkID = 94
	s.bounds = vmath.NewAABB(-0.475, 0, -0.475, 0.95, 0.95, 0.95)
	return s
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例10: newZombie

func newZombie() Entity {
	type zombie struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	z := &zombie{
		debugComponent: debugComponent{17, 114, 156},
	}
	z.NetworkID = 54
	z.bounds = vmath.NewAABB(-0.3, 0, -0.3, 0.6, 1.8, 0.6)
	return z
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例11: newIronGolem

func newIronGolem() Entity {
	type ironGolem struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	i := &ironGolem{
		debugComponent: debugComponent{125, 125, 125},
	}
	i.NetworkID = 99
	i.bounds = vmath.NewAABB(-0.7, 0, -0.7, 1.4, 2.9, 1.4)
	return i
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例12: newVillager

func newVillager() Entity {
	type villager struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	v := &villager{
		debugComponent: debugComponent{212, 183, 142},
	}
	v.NetworkID = 120
	v.bounds = vmath.NewAABB(-0.3, 0, -0.3, 0.6, 1.8, 0.6)
	return v
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例13: newSpider

func newSpider() Entity {
	type spider struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	s := &spider{
		debugComponent: debugComponent{59, 7, 7},
	}
	s.NetworkID = 52
	s.bounds = vmath.NewAABB(-0.7, 0, -0.7, 1.4, 0.9, 1.4)
	return s
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例14: newGuardian

func newGuardian() Entity {
	type guardian struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	g := &guardian{
		debugComponent: debugComponent{69, 47, 71},
	}
	g.NetworkID = 68
	g.bounds = vmath.NewAABB(-0.425, 0, -0.425, 0.85, 0.85, 0.85)
	return g
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例15: newSnowman

func newSnowman() Entity {
	type snowman struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	s := &snowman{
		debugComponent: debugComponent{225, 225, 255},
	}
	s.NetworkID = 97
	s.bounds = vmath.NewAABB(-0.35, 0, -0.35, 0.7, 1.9, 0.7)
	return s
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例16: newSkeleton

func newSkeleton() Entity {
	type skeleton struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	s := &skeleton{
		debugComponent: debugComponent{255, 255, 255},
	}
	s.NetworkID = 51
	s.bounds = vmath.NewAABB(-0.3, 0, -0.3, 0.6, 1.8, 0.6)
	return s
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例17: newCreeper

func newCreeper() Entity {
	type creeper struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	c := &creeper{
		debugComponent: debugComponent{16, 117, 55},
	}
	c.NetworkID = 50
	c.bounds = vmath.NewAABB(-0.2, 0, -0.2, 0.4, 1.5, 0.4)
	return c
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例18: newMooshroom

func newMooshroom() Entity {
	type mooshroom struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	m := &mooshroom{
		debugComponent: debugComponent{145, 41, 0},
	}
	m.NetworkID = 96
	m.bounds = vmath.NewAABB(-0.45, 0, -0.45, 0.9, 1.3, 0.9)
	return m
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例19: newHorse

func newHorse() Entity {
	type horse struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	h := &horse{
		debugComponent: debugComponent{191, 156, 0},
	}
	h.NetworkID = 100
	h.bounds = vmath.NewAABB(-0.7, 0, -0.7, 1.4, 1.6, 1.4)
	return h
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go


示例20: newOcelot

func newOcelot() Entity {
	type ocelot struct {
		networkComponent
		positionComponent
		rotationComponent
		targetRotationComponent
		targetPositionComponent
		sizeComponent

		debugComponent
	}
	o := &ocelot{
		debugComponent: debugComponent{242, 222, 0},
	}
	o.NetworkID = 98
	o.bounds = vmath.NewAABB(-0.3, 0, -0.3, 0.6, 0.8, 0.6)
	return o
}
开发者ID:num5,项目名称:steven,代码行数:18,代码来源:entities.go



注:本文中的github.com/thinkofdeath/steven/type/vmath.NewAABB函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang image.ImageFile类代码示例发布时间:2022-05-28
下一篇:
Golang render.GetTexture函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap