mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
GPUPickEvent
This commit is contained in:
parent
366f497668
commit
8aa0f3d188
@ -6,6 +6,7 @@ import RenderEvent from './RenderEvent';
|
||||
import ResizeEvent from './ResizeEvent';
|
||||
import FilterEvent from './FilterEvent';
|
||||
import ViewEvent from './ViewEvent';
|
||||
import GPUPickEvent from './GPUPickEvent';
|
||||
|
||||
import TransformControlsEvent from './TransformControlsEvent';
|
||||
import ObjectEvent from './ObjectEvent';
|
||||
@ -33,6 +34,7 @@ function EventDispatcher() {
|
||||
new ResizeEvent(),
|
||||
new FilterEvent(),
|
||||
new ViewEvent(),
|
||||
new GPUPickEvent(),
|
||||
|
||||
// viewport中的事件
|
||||
new TransformControlsEvent(),
|
||||
|
||||
29
ShadowEditor.Web/src/event/GPUPickEvent.js
Normal file
29
ShadowEditor.Web/src/event/GPUPickEvent.js
Normal file
@ -0,0 +1,29 @@
|
||||
import BaseEvent from './BaseEvent';
|
||||
|
||||
/**
|
||||
* 使用GPU进行碰撞
|
||||
* @author tengge / https://github.com/tengge1
|
||||
* @param {*} app 应用程序
|
||||
*/
|
||||
function GPUPickEvent(app) {
|
||||
BaseEvent.call(this, app);
|
||||
|
||||
this.onMouseMove = this.onMouseMove.bind(this);
|
||||
}
|
||||
|
||||
GPUPickEvent.prototype = Object.create(BaseEvent.prototype);
|
||||
GPUPickEvent.prototype.constructor = GPUPickEvent;
|
||||
|
||||
GPUPickEvent.prototype.start = function () {
|
||||
app.on(`mousemove.${this.id}`, this.onMouseMove);
|
||||
};
|
||||
|
||||
GPUPickEvent.prototype.stop = function () {
|
||||
app.on(`mousemove.${this.id}`, null);
|
||||
};
|
||||
|
||||
GPUPickEvent.prototype.onMouseMove = function (event) {
|
||||
|
||||
};
|
||||
|
||||
export default GPUPickEvent;
|
||||
Loading…
x
Reference in New Issue
Block a user