自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

江湖夜雨十年灯

脚踏实地,奋力拼搏

  • 博客(16)
  • 收藏
  • 关注

转载 lua设计与实现(三)字符串

概述在Lua虚拟机中存在一个全局的数据区(散列桶),用来存放当前系统中的所有字符串。同一个字符串在Lua虚拟机中只可能有一个副本,一个字符串一单创建,将是不可变更的。变量存放的仅是字符串的引用,而不是其内容Lua字符串内化的优点:传统字符串的比较与查找是根据字符串长度逐位比较,时间复杂度与字符串长度线性相关。而Lua的,在已知字符串散列值的情况下,只需要一次整数比较。多份相同的字符...

2018-10-29 20:47:39 472

转载 lua设计与实现(二)数据类型

lua中的数据类型//lua.h/*** basic types*/#define LUA_TNONE (-1)#define LUA_TNIL 0#define LUA_TBOOLEAN 1#define LUA_TLIGHTUSERDATA 2#define LUA_TNUMBER 3#define LUA_TSTRING 4#define LUA_TTABL...

2018-10-29 18:17:45 251

转载 lua设计与实现(一)概述

虚拟机核心相关文件列表文件名作用对外接口前缀lapi.cC语言接口lua_lcode.c源码生成器luaK_ldebug.c调试库luaG_ldo.c函数调用及栈管理luaD_ldump.i序列化预编译的lua字节码lfunc.c提供操作函数原型及闭包的辅助函数luaF_lgc.cGCluaC_llex....

2018-10-29 13:59:29 858

转载 565. Array Nesting

A zero-indexed array A of length N contains all integers from 0 to N-1. Find and return the longest length of set S, where S[i] = {A[i], A[A[i]], A[A[A[i]]], … } subjected to the rule below.Suppose ...

2018-07-11 17:44:34 136

转载 238. Product of Array Except Self

Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Example:Input: [1,2,3,4] Output: ...

2018-07-11 15:15:14 123

转载 442. Find All Duplicates in an Array

Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in this array.Could you do it without extra ...

2018-07-11 10:43:13 108

转载 532. K-diff Pairs in an Array

Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair (i, j), where i and j are both numbers in...

2018-07-10 17:46:13 102

转载 581. Shortest Unsorted Continuous Subarray

Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.You need to find ...

2018-07-10 15:17:01 99

转载 160. Intersection of Two Linked Lists

Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘ ...

2018-07-10 12:31:15 81

转载 234. Palindrome Linked List

Given a singly linked list, determine if it is a palindrome.Example 1:Input: 1->2 Output: falseExample 2:Input: 1->2->2->1 Output: trueFollow up: Could you do it in O(n) time ...

2018-07-09 20:05:55 93

转载 ue4打包android

1.安装TADP (Tegra Android Development Pack) http://api.unrealengine.com/CHN/Platforms/Android/Reference/index.html2.ProjectSetting https://blog.csdn.net/poem_of_sunshine/article/details/792460753....

2018-06-03 22:00:30 1391

原创 unity PlayableAsset PlayableBehaviour

今天尝试使用unity timeline来做段动画, 发现BasicPlayableBehaviour已弃用, 而新的PlayableBehaviour不能直接往Playable Track拖。 翻了下文档使用PlayableAsset来新建PlayableBehaviour,然后使用ExposedReference,例子:https://docs.unity3d.com/Script...

2018-03-13 16:27:10 5951 1

原创 基本光照模型实现-漫反射

漫反射计算公式兰伯特模型 cdiffuse=(clight⋅mdiffuse)max(0,n^⋅l^)c_{diffuse} = (\mathtt c_{light} \cdot m_{diffuse})\mathrm {max}(0, \hat {\mathcal n} \cdot \hat {\mathcal l})半兰伯特模型 cdiffuse=(clight⋅mdiffuse)(α(n^

2017-10-28 16:02:45 461

原创 基本光照模型实现-高光反射

高光反射计算公式: Phong模型 cspecular=(clight⋅mspecular)max(0,v^⋅r^)mglossc_{specular} = (\mathtt c_{light} \cdot m_{specular})\mathrm {max}(0, \hat {\mathcal v} \cdot \hat {\mathcal r})^{m_{gloss}} r^=l^−2(n

2017-10-28 15:07:20 482

原创 阅读UGUI源码 一

显示一张图片,并给图片添加交互创建空物体,添加组件代码 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class MyImage : MonoBehaviour { VertexHelper

2017-10-08 14:52:36 485

原创 阅读UGUI源码 零

UGUI源码方法:visual studio2017 + 调试;如何调试UGUI? 提示:UGUI作为插件存在于unity中。删除unity自带的UGUI,(目录:Data\UnityExtensions\Unity\GUISystem),将UGUI源码直接放到自己项目工程中 UnityEditor.UI 更名为 Editor(unity规定编辑器的实现类必须叫Editor)重启unity,给

2017-10-08 11:33:29 415

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除