Giter VIP home page Giter VIP logo

fly-thingjs's Introduction

场景

Scene.json文件介绍

{
    "id": "1444",
    "userid": "Cabinet_01",
    "type": "Cabinet",
    "name": "Cab",
    "properties": {
        "Group": "Inside01"
    },
    "model": 17,
    "position": [-5.087, 0.01, 9.347],
    "rotation": [0.0, 0.707, 0.0, 0.707],
    "scale": [0.998, 1.0, 0.999]
}

id 对应 thingjs 对象 uuid 属性。

userid 对应搭建时候填写的 [自定义 ID]。对应 thingjs 物体对象 id 属性。

name 对应搭建时填写的 [名称]。对应 thingjs 物体对象 name 属性。

model 为查找当前物体所用模型,对应 scene.json 中 models 中的索引。

properties 为自定义的属性

type 为自定义属性添加TYPE(TYPE两边有_)。THING.factory.registerClass('Cabinet', Cabinet); app.query('.Cabinet');可以查到这个物体。

ThingJs

  • OOP 定义类。有局限性。
// 加载场景
const app = new THING.App({ 
    "url": "models/comproom/",
    "skyBox" :"BlueSky"
});
class Cabinet extends THING.Thing{
    test(){
        console.log('test');
    }
}
// 场景 json 有物体 type 为 Cabinet ,才能生效。
THING.factory.registerClass('Cabinet', Cabinet);
app.query('.Cabinet')[0].test();

fly-thingjs's People

Contributors

zhangpanqin avatar

Stargazers

 avatar robin avatar  avatar  avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.