美文网首页
Three.js源码学习(十四)core/Object3D

Three.js源码学习(十四)core/Object3D

作者: yuriy0_0 | 来源:发表于2018-06-19 19:13 被阅读0次

    Object3DId=0

    function构造器

    uuid
    name
    type='Object3D’
    parent=null
    children=[]
    up
    position=Vector3()
    rotation=Euler()
    quaternion=Quaternion()
    scale=Vector3(1,1,1)
    modelViewMatrix=Matrix4()
    normalMatrix=Matrix()
    matrixAutoUpdate
    matrixWorldNeedsUpdate=false
    layers= Layers()
    visible=true
    castShadow=false
    frustumCulled=true
    renderOrder=0
    userData={}

    onRotationChange()
    onQuaternionChange()

    全局变量

    DefaultUp=Vector3(0,1,0)
    DefaultMatrixAutoUpdate=true

    原型内方法

    constructor
    isObject3D=true
    onBeforeRender()
    开发中
    onAfterRender()
    开发中
    applyMatrix(matrix)
    applyQuaternion(q)
    矩阵相乘
    setRotationFromAxisAngle(axis,angle)
    在axis已经归一化处理时,旋转坐标轴
    setRotationFromEuler(enler)
    setRotationFromMatrix(m)
    setRotationFromWQuaternion(q)

    rotateOnAxis()
    绕坐标周旋转
    rotateOnWorldAxis()
    旋转世界坐标轴
    rotateX()
    绕x轴旋转
    rotateY()
    绕y轴旋转
    rotateZ()
    绕z轴旋转
    translateOnAxis()
    延坐标轴移动
    translateX()
    延X轴移动
    translateY()
    延Y轴移动
    translateZ()
    延Z轴移动
    localToWorld(vector)
    应用到world矩阵
    worldToLocal()
    lookAt(x,y,z)
    add(object)
    remove(object)
    getObjectById(id)
    getObjectByName(name)
    getObjectByProperty(name,value)
    getWorldPosition(target)
    getWorldQuaternion(target)
    getWorldScale(target)
    getWorldDirection(target)
    raycast()
    开发中
    traverse(callback)
    遍历所有子元素
    traverseVisible(callback)
    遍历所有可见子元素
    traverseAncestors(callback)
    遍历所有祖先
    updateMatrix()
    updateMatrxWorld(force)
    toJSON(meta)
    clone(recursive)
    copy(source,recursive)

    相关文章

      网友评论

          本文标题:Three.js源码学习(十四)core/Object3D

          本文链接:https://www.haomeiwen.com/subject/ipnbeftx.html