зеркало из https://github.com/mozilla/Spoke.git
Merge branch 'master' of https://github.com/MozillaReality/hubs-editor
This commit is contained in:
Коммит
88d3305e5e
|
@ -13452,8 +13452,8 @@
|
|||
}
|
||||
},
|
||||
"three": {
|
||||
"version": "github:mozillareality/three.js#09b27a6628e7dd5422db2ebfafa24d198ddb0b16",
|
||||
"from": "github:mozillareality/three.js#09b27a6628e7dd5422db2ebfafa24d198ddb0b16"
|
||||
"version": "github:mozillareality/three.js#892c7c7f79e1bfaf9eb2b869772a796bd1ff8717",
|
||||
"from": "github:mozillareality/three.js#892c7c7f7"
|
||||
},
|
||||
"throttle-debounce": {
|
||||
"version": "2.0.1",
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
"react-tooltip": "^3.6.1",
|
||||
"selfsigned": "^1.10.3",
|
||||
"signals": "^1.0.0",
|
||||
"three": "github:mozillareality/three.js#09b27a6628e7dd5422db2ebfafa24d198ddb0b16",
|
||||
"three": "github:mozillareality/three.js#892c7c7f7",
|
||||
"throttle-debounce": "^2.0.1",
|
||||
"ws": "^5.2.0"
|
||||
},
|
||||
|
|
|
@ -401,13 +401,6 @@ export default class Editor {
|
|||
scene.name = "Scene";
|
||||
}
|
||||
|
||||
scene.userData._conflictHandler = new ConflictHandler();
|
||||
scene.userData._conflictHandler.findDuplicates(scene, 0, 0);
|
||||
|
||||
if (scene.userData._conflictHandler.getDuplicateStatus() || scene.userData._conflictHandler.getMissingStatus()) {
|
||||
throw new ConflictError("gltf naming conflicts", "import", url, scene.userData._conflictHandler);
|
||||
}
|
||||
|
||||
return scene;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ export default class BaseComponent {
|
|||
|
||||
static canRemove = true;
|
||||
|
||||
static showProps = true;
|
||||
|
||||
constructor(node, object) {
|
||||
this.name = this.constructor.componentName;
|
||||
this.schema = this.constructor.schema;
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
import THREE from "../three";
|
||||
import TransformComponent from "./TransformComponent";
|
||||
|
||||
export default class BoxColliderComponent extends TransformComponent {
|
||||
static componentName = "box-collider";
|
||||
|
||||
static _geometry = new THREE.BoxBufferGeometry();
|
||||
|
||||
static _material = new THREE.Material();
|
||||
|
||||
static canAdd = true;
|
||||
|
||||
static canRemove = true;
|
||||
|
||||
// Since the box collider props just mirror the node's transform, we hide the props.
|
||||
static showProps = false;
|
||||
|
||||
static dontExportProps = false;
|
||||
|
||||
static async inflate(node, _props) {
|
||||
const boxMesh = new THREE.Mesh(this._geometry, this._material);
|
||||
const box = new THREE.BoxHelper(boxMesh, 0x00ff00);
|
||||
box.userData._selectionRoot = node;
|
||||
Object.defineProperty(box.userData, "_selectionRoot", { value: node, configurable: true, enumerable: false });
|
||||
box.userData._dontExport = true;
|
||||
box.userData._dontShowInHierarchy = true;
|
||||
box.userData._inflated = true;
|
||||
const component = await this._getOrCreateComponent(node, _props);
|
||||
node.add(box);
|
||||
return component;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
import AmbientLightComponent from "./AmbientLightComponent";
|
||||
import BoxColliderComponent from "./BoxColliderComponent";
|
||||
import DirectionalLightComponent from "./DirectionalLightComponent";
|
||||
import GLTFModelComponent from "./GLTFModelComponent";
|
||||
import HemisphereLightComponent from "./HemisphereLightComponent";
|
||||
|
@ -24,6 +25,7 @@ export * from "./utils";
|
|||
|
||||
export const Components = [
|
||||
AmbientLightComponent,
|
||||
BoxColliderComponent,
|
||||
DirectionalLightComponent,
|
||||
GLTFModelComponent,
|
||||
HemisphereLightComponent,
|
||||
|
|
|
@ -49,7 +49,8 @@ const Option = props => {
|
|||
|
||||
Option.propTypes = {
|
||||
label: PropTypes.string,
|
||||
value: PropTypes.string
|
||||
value: PropTypes.string,
|
||||
data: PropTypes.object
|
||||
};
|
||||
|
||||
const DropdownIndicator = () => {
|
||||
|
|
|
@ -220,16 +220,17 @@ class PropertiesPanelContainer extends Component {
|
|||
contentClassName={contentClassName}
|
||||
useDefault={useDefault}
|
||||
>
|
||||
{componentDefinition.schema.map(prop => (
|
||||
<InputGroup name={getDisplayName(prop.name)} key={prop.name} disabled={saveable && !component.src}>
|
||||
{componentTypeMappings.get(prop.type)(
|
||||
component.props[prop.name],
|
||||
component.propValidation[prop.name],
|
||||
this.onChangeComponent.bind(null, component, prop.name),
|
||||
this.getExtras(prop)
|
||||
)}
|
||||
</InputGroup>
|
||||
))}
|
||||
{componentDefinition.showProps &&
|
||||
componentDefinition.schema.map(prop => (
|
||||
<InputGroup name={getDisplayName(prop.name)} key={prop.name} disabled={saveable && !component.src}>
|
||||
{componentTypeMappings.get(prop.type)(
|
||||
component.props[prop.name],
|
||||
component.propValidation[prop.name],
|
||||
this.onChangeComponent.bind(null, component, prop.name),
|
||||
this.getExtras(prop)
|
||||
)}
|
||||
</InputGroup>
|
||||
))}
|
||||
</PropertyGroup>
|
||||
);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче